aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2015-07-19 03:53:03 +0200
committerVG <vg@devys.org>2015-07-19 03:53:03 +0200
commit5064abaac3be3792bf40e56ce215c09f2f0c9434 (patch)
tree61508113eb4d1496145364e507dfb04e1dd39113
parent3cbf206e350635ac1849f4b9fa519c04ad993dda (diff)
downloaduuidxer-5064abaac3be3792bf40e56ce215c09f2f0c9434.tar.gz
uuidxer-5064abaac3be3792bf40e56ce215c09f2f0c9434.tar.bz2
uuidxer-5064abaac3be3792bf40e56ce215c09f2f0c9434.zip
skip uuid.txt creation when no files in the directory
-rwxr-xr-xscan.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scan.py b/scan.py
index cfae385..eb24db4 100755
--- a/scan.py
+++ b/scan.py
@@ -35,6 +35,8 @@ def main():
db = []
with open(DB_FILENAME + '.new', 'wb') as out:
for root, dirs, files in os.walk(START_DIR):
+ if not len(files):
+ continue
files, uuids = partition(lambda f: '/uuid.txt' in f,
(os.path.join(root, f) for f in files))
if len(uuids) == 1: