Added support for the infrastructure for on demand access/create the

server connection.

The BaseDriver and BaseConnection are two abstract classes, which allows
us to replace the existing driver with the currently used. The current
implementation supports to connect the PostgreSQL and Postgres Plus
Advanced Server using the psycopg2 driver.
This commit is contained in:
Ashesh Vashi
2015-10-20 12:33:18 +05:30
parent b52d72f176
commit e27e39a8f3
34 changed files with 2625 additions and 417 deletions

View File

@@ -41,9 +41,11 @@ if config.SERVER_MODE is True:
# Check if the database exists. If it does not, tell the user and exit.
if not os.path.isfile(config.SQLITE_PATH):
print "The configuration database %s does not exist.\n" % config.SQLITE_PATH
print "The configuration database %s does not exist.\n" \
% config.SQLITE_PATH
print "Please run 'python %s' to create it.\nExiting..." % os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'setup.py')
os.path.dirname(os.path.realpath(__file__)), 'setup.py'
)
sys.exit(1)
##########################################################################
@@ -55,6 +57,8 @@ app = create_app()
if config.DEBUG:
app.debug = True
else:
app.debug = False
# Start the web server. The port number should have already been set by the
# runtime if we're running in desktop mode, otherwise we'll just use the
@@ -70,6 +74,6 @@ else:
server_port = config.DEFAULT_SERVER_PORT
try:
app.run(port=server_port)
app.run(port=server_port, use_reloader=(config.SERVER_MODE and app.debug))
except IOError:
app.logger.error("Error starting the app server: %s", sys.exc_info())