More auto-indenting

This commit is contained in:
TEC 2020-10-05 18:52:29 +08:00
parent 9010325a56
commit 2238736cc9
2 changed files with 356 additions and 355 deletions

File diff suppressed because it is too large Load diff

View file

@ -58,7 +58,7 @@ def processLine(line):
if parameter == "IMAPAccount": if parameter == "IMAPAccount":
if currentAccountNumber > 0: if currentAccountNumber > 0:
finaliseAccount() finaliseAccount()
newAccount(value) newAccount(value)
elif parameter in mbsyncInotifyMapping.keys(): elif parameter in mbsyncInotifyMapping.keys():
parser, key = mbsyncInotifyMapping[parameter] parser, key = mbsyncInotifyMapping[parameter]
currentAccountData[key] = parser(value) currentAccountData[key] = parser(value)
@ -117,8 +117,8 @@ def finaliseAccount():
print(f" \033[1;37m{key:<13} {valColor}{val}\033[0;37m") print(f" \033[1;37m{key:<13} {valColor}{val}\033[0;37m")
if ( if (
len(currentAccountData["boxes"]) > 15 len(currentAccountData["boxes"]) > 15
and "@gmail.com" in currentAccountData["username"] and "@gmail.com" in currentAccountData["username"]
): ):
print( print(
" \033[1;31mWarning:\033[0;31m Gmail raises an error when more than" " \033[1;31mWarning:\033[0;31m Gmail raises an error when more than"
@ -210,7 +210,7 @@ def enableAccountSystemdServices(accounts):
for account in accounts: for account in accounts:
print(f" \033[0;32m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True) print(f" \033[0;32m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True)
if setSystemdServiceState( if setSystemdServiceState(
"enable", f"goimapnotify@{accountToFoldername(account)}.service" "enable", f"goimapnotify@{accountToFoldername(account)}.service"
): ):
print("\033[1;32m enabled") print("\033[1;32m enabled")
@ -219,7 +219,7 @@ def disableAccountSystemdServices(accounts):
for account in accounts: for account in accounts:
print(f" \033[0;33m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True) print(f" \033[0;33m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True)
if setSystemdServiceState( if setSystemdServiceState(
"disable", f"goimapnotify@{accountToFoldername(account)}.service" "disable", f"goimapnotify@{accountToFoldername(account)}.service"
): ):
print("\033[1;33m disabled") print("\033[1;33m disabled")
@ -228,7 +228,7 @@ def restartAccountSystemdServices(accounts):
for account in accounts: for account in accounts:
print(f" \033[0;34m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True) print(f" \033[0;34m - \033[1;37m{account:<18}", end="\033[0;37m", flush=True)
if setSystemdServiceState( if setSystemdServiceState(
"restart", f"goimapnotify@{accountToFoldername(account)}.service" "restart", f"goimapnotify@{accountToFoldername(account)}.service"
): ):
print("\033[1;34m restarted") print("\033[1;34m restarted")