Skip to content

Commit

Permalink
explicitly sort glob results for an implicit progress bar, fixes #291
Browse files Browse the repository at this point in the history
  • Loading branch information
Prinzhorn committed Nov 18, 2020
1 parent 2299a42 commit 430085e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,3 @@
# Next

- Process file globs in a sorted order (#291)
2 changes: 1 addition & 1 deletion import_logs.py
Expand Up @@ -938,7 +938,7 @@ def _parse_args(self, option_parser, argv = None):
if self.filename == '-':
all_filenames.append(self.filename)
else:
all_filenames = all_filenames + glob.glob(self.filename)
all_filenames = all_filenames + sorted(glob.glob(self.filename))
self.filenames = all_filenames

# Configure logging before calling logging.{debug,info}.
Expand Down
1 change: 0 additions & 1 deletion tests/test_main.py
Expand Up @@ -1105,7 +1105,6 @@ def test_glob_filenames():

config = import_logs.Configuration(argv)

filenames = sorted(config.filenames)
assert filenames == ['logs/common.log', 'logs/common_complete.log', 'logs/common_encoding_big5.log', 'logs/common_vhost.log', 'logs/elb.log']

# UrlHelper tests
Expand Down

0 comments on commit 430085e

Please sign in to comment.