Clean up empty encrypted directories

This commit is contained in:
Jarno Seppänen 2014-05-18 12:40:07 +03:00
parent a20e459b97
commit 295a642522
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ class GpgStore(object):
def delete(self, path):
os.remove(self.encroot + '/' + path)
if len(path) >= 3 and path[2] == '/':
try:
os.rmdir(self.encroot + '/' + path[:2])
except OSError:
pass
log.debug('deleted %s' % path)
def exists(self, path):