Commit 0f38452b authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Make a glob more specific

parent 13be8a79
......@@ -41,8 +41,9 @@ def _get_older_files_than(dname, num_days_ago, extensions):
# Cannot use ** and recursive=True in glob() because we support 3.4
# So instead settle on finding files in the datadir and one
# subdirectory below the datadir that fit the form of YYYY-MM-DD*.txt
patterns = [os.path.join(dname, '*-*-*{}'.format(ext)),
os.path.join(dname, '*', '*-*-*{}'.format(ext))]
day_part = '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
patterns = [os.path.join(dname, '{}*{}'.format(day_part, ext)),
os.path.join(dname, '*', '{}*{}'.format(day_part, ext))]
for pattern in patterns:
for fname in glob(pattern):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment