wrap all code into function

simplify calling this module from the outside
This commit is contained in:
porthole-ascend-cinnamon 2022-03-18 16:13:28 +02:00 committed by GitHub
parent b17a1c157d
commit 50ced7855b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1294,7 +1294,7 @@ def handleProxyList(con, proxy_li, proxy_ty, url=None):
return proxies
if __name__ == '__main__':
def main(argv):
with open(__dir__ / "config.json") as f:
con = load(f)
with suppress(KeyboardInterrupt):
@ -1450,3 +1450,7 @@ if __name__ == '__main__':
exit()
ToolsConsole.usage()
if __name__ == '__main__':
main(argv)