summarylogtreecommitdiffstats
path: root/pgAdmin4.py.patch
blob: 2046f269f5a329ac0ddffe49c485084726342921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- a/web/pgAdmin4.py
+++ b/web/pgAdmin4.py

@@ -140,7 +140,10 @@
 ##########################################################################
 # The entry point
 ##########################################################################
+import threading
+from arch_additions import setupTrayIcon, checkRunning
 def main():
+    checkRunning();
     # Set null device file path to stdout, stdin, stderr if they are None
     for _name in ('stdin', 'stdout', 'stderr'):
         if getattr(sys, _name) is None:
@@ -214,8 +217,11 @@
                 server_name=config.APP_NAME)
             try:
                 print("Using production server...")
-                prod_server.start()
-            except KeyboardInterrupt:
+                prod_server.prepare()
+                threading.Thread(target=prod_server.serve).start()
+
+                setupTrayIcon("http://{}:{}".format(config.DEFAULT_SERVER, config.EFFECTIVE_SERVER_PORT))
+            finally:
                 prod_server.stop()
 
     except IOError: