Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #188 from wufeifei/develop
Browse files Browse the repository at this point in the history
fix empty extension #187
  • Loading branch information
FeeiCN authored Nov 3, 2016
2 parents 3ad0cc0 + 39f32ba commit 796edb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pickup/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def files(self, directory, level=1):
for filename in os.listdir(directory):
path = os.path.join(directory, filename)

# Statistic File Type Count
file_name, file_extension = os.path.splitext(path)
self.type_nums.setdefault(file_extension.lower(), []).append(filename)

# Directory Structure
# logging.debug('| ' * (level - 1) + '|--' + filename)
if os.path.isdir(path):
self.files(path, level + 1)
if os.path.isfile(path):
# Statistic File Type Count
file_name, file_extension = os.path.splitext(path)
self.type_nums.setdefault(file_extension.lower(), []).append(filename)

path = path.replace(self.path, '')
self.file.append(path)
self.file_id += 1
Expand Down

0 comments on commit 796edb0

Please sign in to comment.