From 5064abaac3be3792bf40e56ce215c09f2f0c9434 Mon Sep 17 00:00:00 2001 From: VG Date: Sun, 19 Jul 2015 03:53:03 +0200 Subject: skip uuid.txt creation when no files in the directory --- scan.py | 2 ++ 1 file changed, 2 insertions(+) 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: -- cgit v1.2.3