Forráskód Böngészése

Use main_wrapper for client in debug mode

Eren Yilmaz 5 éve
szülő
commit
fe4d93ee97
1 módosított fájl, 9 hozzáadás és 2 törlés
  1. 9 2
      run_client.py

+ 9 - 2
run_client.py

@@ -6,7 +6,7 @@ import time
 import client_controller
 from debug import debug
 from lib.print_exc_plus import print_exc_plus
-from util import yn_dialog
+from util import yn_dialog, main_wrapper
 
 
 def fake_loading_bar(msg, duration=5.):
@@ -113,8 +113,15 @@ def one_command():
                 print('An unknown error occurred while executing a command.')
 
 
-if __name__ == '__main__':
+def main():
     load()
     welcome()
     while not client_controller.exiting:
         one_command()
+
+
+if debug:
+    main = main_wrapper(main)
+
+if __name__ == '__main__':
+    main()