Bugfix for the removal of empty sub-directories.
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user