Bugfix for the removal of empty sub-directories.

This commit is contained in:
Simon
2013-02-23 15:39:51 +01:00
parent 9d80827f74
commit 16ac982efe
2 changed files with 3 additions and 2 deletions

View File

@@ -105,7 +105,8 @@ class PathsDb(object):
self.db['paths_list'].remove(path)
del self.db[path]
parent = os.path.normpath(join(path, '..'))
self.db[parent]['subdir'].remove(path)
child = os.path.relpath(path, parent)
self.db[parent]['subdir'].remove(child)
def check_thumbnail(self, path):
"Find the thumbnail image for a given path."

View File

@@ -60,7 +60,7 @@ class TestPathsDb(unittest.TestCase):
self.assertListEqual(self.db['paths_list'],
['.', 'dir1', 'dir1/test1', 'dir1/test2', 'dir2'])
self.assertListEqual(self.db['skipped_dir'], ['empty'])
self.assertItemsEqual(self.db['skipped_dir'], ['empty', 'dir1/empty'])
self.assertListEqual(self.db['.']['img'], [])
self.assertItemsEqual(self.db['.']['subdir'], ['dir1', 'dir2'])