Less indentation

main
Bob Mottram 2020-06-02 10:05:55 +01:00
parent 36381b9fcf
commit 20a24edaa8
1 changed files with 14 additions and 12 deletions

View File

@ -2233,14 +2233,15 @@ def clearQueueItems(baseDir: str, queue: []) -> None:
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for account in dirs:
queueDir = baseDir + '/accounts/' + account + '/queue'
if os.path.isdir(queueDir):
for queuesubdir, queuedirs, queuefiles in os.walk(queueDir):
for qfile in queuefiles:
try:
os.remove(os.path.join(queueDir, qfile))
ctr += 1
except BaseException:
pass
if not os.path.isdir(queueDir):
continue
for queuesubdir, queuedirs, queuefiles in os.walk(queueDir):
for qfile in queuefiles:
try:
os.remove(os.path.join(queueDir, qfile))
ctr += 1
except BaseException:
pass
if ctr > 0:
print('Removed ' + str(ctr) + ' inbox queue items')
@ -2252,10 +2253,11 @@ def restoreQueueItems(baseDir: str, queue: []) -> None:
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for account in dirs:
queueDir = baseDir + '/accounts/' + account + '/queue'
if os.path.isdir(queueDir):
for queuesubdir, queuedirs, queuefiles in os.walk(queueDir):
for qfile in queuefiles:
queue.append(os.path.join(queueDir, qfile))
if not os.path.isdir(queueDir):
continue
for queuesubdir, queuedirs, queuefiles in os.walk(queueDir):
for qfile in queuefiles:
queue.append(os.path.join(queueDir, qfile))
if len(queue) > 0:
print('Restored ' + str(len(queue)) + ' inbox queue items')