Save the runtime status information in the application object for using

it other places.

globals() does not return consistent value across the application
context.

Thanks Neel Patel for reporting the issue.
This commit is contained in:
Ashesh Vashi
2016-06-21 15:12:20 +05:30
parent d133e33c4b
commit a35288e25d
2 changed files with 5 additions and 8 deletions

View File

@@ -72,6 +72,9 @@ else:
config.DEFAULT_SERVER_PORT)
server_port = config.DEFAULT_SERVER_PORT
# Let the application save the status about the runtime for using it later.
app.PGADMIN_RUNTIME = PGADMIN_RUNTIME
# Output a startup message if we're not under the runtime
if not PGADMIN_RUNTIME:
print("Starting %s. Please navigate to http://localhost:%d in your browser." %