3 # Main script to run the dakweb server and also
4 # to provide the list_paths and path_help functions
6 from sqlalchemy import or_
8 from daklib.dbconn import DBConn, DBSource, Suite, DSCFile, PoolFile
11 from dakweb.webregister import QueryRegister
15 """Returns a useless welcome message"""
16 return json.dumps('Use the /list_paths path to list all available paths')
17 QueryRegister().register_path('/', root_path)
19 @bottle.route('/list_paths')
21 """Returns a list of available paths"""
22 return json.dumps(QueryRegister().get_paths())
23 QueryRegister().register_path('/list_paths', list_paths)
25 @bottle.route('/path_help/<path>')
26 def path_help(path=None):
29 return bottle.HTTPError(503, 'Path not specified.')
31 return json.dumps(QueryRegister().get_path_help(path))
32 QueryRegister().register_path('/path_help', list_paths)
34 # Import our other methods
35 from queries.source import *
37 # Set up our initial database connection
40 # Run the bottle if we're called directly
41 if __name__ == '__main__':