From 3e5ff202e6ebd12cdaf6f795d2273458396a2039 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Jun 2020 23:08:50 +0100 Subject: [PATCH] Less indentation --- shares.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/shares.py b/shares.py index 11cf7c34..92d1bc84 100644 --- a/shares.py +++ b/shares.py @@ -174,17 +174,18 @@ def addShare(baseDir: str, # indicate that a new share is available for subdir, dirs, files in os.walk(baseDir + '/accounts'): for handle in dirs: - if '@' in handle: - accountDir = baseDir + '/accounts/' + handle - newShareFile = accountDir + '/.newShare' - if not os.path.isfile(newShareFile): - nickname = handle.split('@')[0] - try: - with open(newShareFile, 'w') as fp: - fp.write(httpPrefix + '://' + domainFull + - '/users/' + nickname + '/tlshares') - except BaseException: - pass + if '@' not in handle: + continue + accountDir = baseDir + '/accounts/' + handle + newShareFile = accountDir + '/.newShare' + if not os.path.isfile(newShareFile): + nickname = handle.split('@')[0] + try: + with open(newShareFile, 'w') as fp: + fp.write(httpPrefix + '://' + domainFull + + '/users/' + nickname + '/tlshares') + except BaseException: + pass def expireShares(baseDir: str) -> None: