1
0
mirror of https://github.com/obskyr/khinsider.git synced 2025-08-20 20:01:29 +02:00

Only define the main function if run as a script.

This commit is contained in:
obskyr
2014-10-23 23:46:46 +02:00
parent fbd8709d58
commit d83f49f2ed

View File

@@ -81,7 +81,8 @@ def search(term):
# --- And now for the execution. ---
def doIt(): # Only in a function to be able to stop after errors, really.
if __name__ == '__main__':
def doIt(): # Only in a function to be able to stop after errors, really.
try:
ostName = sys.argv[1]
except IndexError:
@@ -108,5 +109,4 @@ def doIt(): # Only in a function to be able to stop after errors, really.
os.rmdir(ostName)
return
if __name__ == '__main__':
doIt()