From 0e1bfe05c995a099342a68455dd54fc3665df320 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 17 Jul 2014 12:50:31 +0200 Subject: [PATCH] Ignoring song files not ending with '.sg' or '.is' --- patacrep/content/song.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patacrep/content/song.py b/patacrep/content/song.py index bff18bb1..b83fd134 100755 --- a/patacrep/content/song.py +++ b/patacrep/content/song.py @@ -74,6 +74,15 @@ def parse(keyword, argument, contentlist, config): continue with files.chdir(songdir.datadir): for filename in glob.iglob(os.path.join(songdir.subpath, elem)): + if not ( + filename.endswith('.sg') or + filename.endswith('.is') + ): + LOGGER.warning(( + 'File "{}" is not a ".sg" or ".is" file. Ignored.' + ).format(os.path.join(songdir.datadir, filename)) + ) + continue LOGGER.debug('Parsing file "{}"…'.format(filename)) song = SongRenderer( songdir.datadir,