mirror of
https://github.com/obskyr/khinsider.git
synced 2025-08-20 03:42:10 +02:00
Only define the main function if run as a script.
This commit is contained in:
@@ -81,6 +81,7 @@ def search(term):
|
|||||||
|
|
||||||
# --- And now for the execution. ---
|
# --- And now for the execution. ---
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
def doIt(): # Only in a function to be able to stop after errors, really.
|
def doIt(): # Only in a function to be able to stop after errors, really.
|
||||||
try:
|
try:
|
||||||
ostName = sys.argv[1]
|
ostName = sys.argv[1]
|
||||||
@@ -108,5 +109,4 @@ def doIt(): # Only in a function to be able to stop after errors, really.
|
|||||||
os.rmdir(ostName)
|
os.rmdir(ostName)
|
||||||
return
|
return
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
doIt()
|
doIt()
|
||||||
|
Reference in New Issue
Block a user