diff --git a/patacrep/content/song.py b/patacrep/content/song.py index eaef5663..c7925354 100755 --- a/patacrep/content/song.py +++ b/patacrep/content/song.py @@ -78,7 +78,7 @@ def parse(keyword, argument, contentlist, config): if not os.path.isdir(songdir.datadir): continue with files.chdir(songdir.datadir): - # Starting with Python 3.5 glog can be recursive: **/*.csg for instance + # Starting with Python 3.5 glob can be recursive: **/*.csg for instance # for filename in glob.iglob(os.path.join(songdir.subpath, elem), recursive=True): for filename in glob.iglob(os.path.join(songdir.subpath, elem)): LOGGER.debug('Parsing file "{}"…'.format(filename)) diff --git a/patacrep/utils.py b/patacrep/utils.py index c096ac01..1b95b398 100644 --- a/patacrep/utils.py +++ b/patacrep/utils.py @@ -80,9 +80,9 @@ def yesno(string): )) @contextlib.contextmanager -def logging_reduced(module_name): +def logging_reduced(module_name, tmp_level=logging.CRITICAL): logger = logging.getLogger(module_name) - previous_loglevel = logger.getEffectiveLevel() - logger.setLevel(logging.CRITICAL) + old_level = logger.getEffectiveLevel() + logger.setLevel(tmp_level) yield - logger.setLevel(previous_loglevel) + logger.setLevel(old_level) diff --git a/test/test_content/glob.control b/test/test_content/glob.control new file mode 100644 index 00000000..a30583cc --- /dev/null +++ b/test/test_content/glob.control @@ -0,0 +1 @@ +["chordpro.csg"] \ No newline at end of file diff --git a/test/test_content/glob.source b/test/test_content/glob.source new file mode 100644 index 00000000..167ab6ab --- /dev/null +++ b/test/test_content/glob.source @@ -0,0 +1 @@ +["*.csg"] \ No newline at end of file