Remove main function from appID.py (#1455)

We can save some lines, plus best practice is referencing sys.argv
in __main__ block only.
This commit is contained in:
Riccardo Pittau 2025-04-19 11:19:39 +02:00 committed by GitHub
parent dfb0dd3c1e
commit 251a3974cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,16 +17,8 @@ def get_app_id(exe, appname):
return id_int
def main():
"""Get the two arguments and send them to get_app_id"""
exe = sys.argv[1]
appname = sys.argv[2]
print(get_app_id(exe, appname))
if __name__ == "__main__":
# If there aren't the correct number of arguments, fail with error
if len(sys.argv) != 3:
sys.exit("Not enough arguments")
main()
print(get_app_id(sys.argv[1], sys.argv[2]))