businesstrips/tools/shell.py

24 lines
700 B
Python
Raw Normal View History

2014-04-18 23:43:54 +04:00
#!/usr/bin/python -i
'''
Created on 16.12.2010
@author: morozov
'''
if __name__ == '__main__':
import os, sys, datetime
toolsdir = os.path.dirname(__file__)
if toolsdir == '':
toolsdir = '.'
serverdir = toolsdir + os.sep + '..'
sys.path.append(serverdir + os.sep + 'include')
import functions
import database
config = functions.readConfig()
try:
db = database.dbOperations(dbname = config.mysql_database, user = config.mysql_user, password = config.mysql_password, host = config.mysql_server, port = int(config.mysql_port))
except:
print('Error!')
else:
print('Created instance (named \'db\') of \'dbOperations\' class.')