1
0
Fork 0
mirror of https://github.com/kastdeur/lilydrum.git synced 2024-12-22 09:13:33 +01:00

Only try to check for drum/pipe file if they are not set to ''

This commit is contained in:
Eric Teunis de Boone 2016-07-15 00:25:05 +02:00
parent 94c729bd00
commit e0ee5bb7e0

View file

@ -29,10 +29,10 @@ class MakeDrum:
help='show Lilypond version and exit')
parser.add_argument('-x', '--drumfile',
dest='lilydrum', default=os.path.join(self.MASTER_DIR,'lilydrum.ly'),
dest='lilydrum', nargs='+', default=os.path.join(self.MASTER_DIR,'lilydrum.ly'),
help='Use the specified file for drums')
parser.add_argument('-c', '--pipefile',
dest='lilypipe', default='bagpipe.ly',
dest='lilypipe', nargs='+', default=os.path.join(self.MASTER_DIR,'bagpipe.ly'),
help='Use the specified file for pipes')
parser.add_argument('-i', '--include',
dest='includes', nargs='*', default=[],action='append',
@ -185,11 +185,12 @@ class MakeDrum:
include_drum_file = False
include_pipe_file = False
# find out whether drum, pipes, or full score
if self.args.lilydrum and self.args.lilydrum != '':
for ext in ['full', 'side', 'tenor', 'bass', 'drum', 'snare']:
if ext in file:
include_drum_file = True
break
if self.args.lilypipe and self.args.lilypipe != '':
for ext in ['full', 'pipes']:
if ext in file:
include_pipe_file = True
@ -200,6 +201,7 @@ class MakeDrum:
if include_pipe_file:
self.args.includes.insert(0, self.args.lilypipe)
# set up a tmp file with template and file combined
tmp_file = os.path.join(tmp_dir, self.TMP_PREFIX + os.path.relpath(file).replace('../','').replace('music/','',1).replace('/', '-')[:-3] + self.args.suffix + '.ly')
@ -217,6 +219,7 @@ class MakeDrum:
if not incline.startswith('\\'): #already absolute
incline = os.path.join(os.path.abspath(os.path.dirname(relpath)), incline)
if compilable:
try:
inc_file = io.open(incline,'r',encoding='utf8')