-
Notifications
You must be signed in to change notification settings - Fork 1
/
bluegrass.py
29 lines (23 loc) · 918 Bytes
/
bluegrass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import argparse
import stylecompiler
import sys
import os
def get_own_path():
pathname = os.path.dirname(sys.argv[0])
ap = os.path.abspath(pathname)
return ap
def setup_argument_parser():
parser = argparse.ArgumentParser(
description="Arrange compiler for lilypond.",
epilog="Thank you for smoking bluegrass.")
parser.add_argument("-i", "--inputfile", dest="inputfile", default=["samples/test_muteunmute_melody_lyrics.yaml"], nargs=1)
parser.add_argument("-o", "--outputfile", dest="outputfile", default=["output/cowboy.ly"], nargs=1)
parser.add_argument("-f", "--force", dest="force", action="store_true", default=False)
return parser
if __name__ == "__main__":
p = setup_argument_parser()
options = p.parse_args()
rootpath = get_own_path()
print("*** rootpath = ", rootpath)
s = stylecompiler.StyleCompiler(rootpath, options)
s.compile()