From 2668d89ca2a5b3d945dc85d06e4b111e64b33332 Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 9 Sep 2016 13:39:11 +0200 Subject: [PATCH] small cleanups --- larigira/audiogen_randomdir.py | 6 ++---- larigira/timeform_frequency.py | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/larigira/audiogen_randomdir.py b/larigira/audiogen_randomdir.py index abf9b17..2d6ac10 100644 --- a/larigira/audiogen_randomdir.py +++ b/larigira/audiogen_randomdir.py @@ -8,11 +8,9 @@ import fnmatch def scan_dir(dirname, extension=None): if extension is None: - fnfilter = lambda fnames: fnames - else: - fnfilter = lambda fnames: fnmatch.filter(fnames, extension) + extension = '*' for root, dirnames, filenames in os.walk(dirname): - for fname in fnfilter(filenames): + for fname in fnmatch.filter(filenames, extension): yield os.path.join(root, fname) diff --git a/larigira/timeform_frequency.py b/larigira/timeform_frequency.py index bc2cb4a..43adad9 100644 --- a/larigira/timeform_frequency.py +++ b/larigira/timeform_frequency.py @@ -1,5 +1,4 @@ from datetime import datetime - from pytimeparse.timeparse import timeparse from flask_wtf import Form from wtforms import StringField, DateTimeField, validators, \