|
@ -22,7 +22,7 @@ def argument_parser(args): |
|
|
Book to compile. |
|
|
Book to compile. |
|
|
""")) |
|
|
""")) |
|
|
|
|
|
|
|
|
parser.add_argument('--datadir', '-d', nargs=1, type=str, action='store', default=".", |
|
|
parser.add_argument('--datadir', '-d', nargs=1, type=str, action='store', |
|
|
help=textwrap.dedent("""\ |
|
|
help=textwrap.dedent("""\ |
|
|
Data location. Expected (not necessarily required) subdirectories are 'songs', 'img', 'latex', 'templates'. |
|
|
Data location. Expected (not necessarily required) subdirectories are 'songs', 'img', 'latex', 'templates'. |
|
|
""")) |
|
|
""")) |
|
@ -44,11 +44,13 @@ def main(): |
|
|
sb = json.load(f) |
|
|
sb = json.load(f) |
|
|
f.close() |
|
|
f.close() |
|
|
|
|
|
|
|
|
if 'datadir' in sb.keys(): |
|
|
if options.datadir is not None: |
|
|
|
|
|
sb['datadir'] = options.datadir |
|
|
|
|
|
elif 'datadir' in sb.keys(): |
|
|
if not os.path.isabs(sb['datadir']): |
|
|
if not os.path.isabs(sb['datadir']): |
|
|
sb['datadir'] = os.path.join(os.path.dirname(sbFile), sb['datadir']) |
|
|
sb['datadir'] = os.path.join(os.path.dirname(sbFile), sb['datadir']) |
|
|
else: |
|
|
else: |
|
|
sb['datadir'] = options.datadir |
|
|
sb['datadir'] = os.path.dirname(sbFile) |
|
|
buildsongbook(sb, basename) |
|
|
buildsongbook(sb, basename) |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|