|
@ -37,21 +37,17 @@ def parse(keyword, argument, contentlist, config): |
|
|
if 'languages' not in config: |
|
|
if 'languages' not in config: |
|
|
config['languages'] = set() |
|
|
config['languages'] = set() |
|
|
songlist = [] |
|
|
songlist = [] |
|
|
if not contentlist: |
|
|
for songdir in config['songdir']: |
|
|
|
|
|
if contentlist: |
|
|
|
|
|
break |
|
|
contentlist = [ |
|
|
contentlist = [ |
|
|
os.path.relpath( |
|
|
os.path.relpath(filename, songdir) |
|
|
filename, |
|
|
|
|
|
os.path.join(config['datadir'][0], 'songs'), |
|
|
|
|
|
) |
|
|
|
|
|
for filename |
|
|
for filename |
|
|
in recursive_find( |
|
|
in recursive_find(songdir, "*.sg") |
|
|
os.path.join(config['datadir'][0], 'songs'), |
|
|
|
|
|
"*.sg" |
|
|
|
|
|
) |
|
|
|
|
|
] |
|
|
] |
|
|
for elem in contentlist: |
|
|
for elem in contentlist: |
|
|
before = len(songlist) |
|
|
before = len(songlist) |
|
|
for songdir in [os.path.join(d, 'songs') for d in config['datadir']]: |
|
|
for songdir in config['songdir']: |
|
|
for filename in glob.iglob(os.path.join(songdir, elem)): |
|
|
for filename in glob.iglob(os.path.join(songdir, elem)): |
|
|
LOGGER.debug('Parsing file "{}"…'.format(filename)) |
|
|
LOGGER.debug('Parsing file "{}"…'.format(filename)) |
|
|
song = SongRenderer(filename, config) |
|
|
song = SongRenderer(filename, config) |
|
|