Example #1
0
######################################################################
# Everything starts here
######################################################################
        
configfilename = current_dir+'/lri_config.json'
if len(sys.argv) > 1:
    configfilename = sys.argv[1]

#  Try to setup server
valid_setup = True
try:
    config = json.loads(open(configfilename).read())
    try:
        ext_cache = cache.make_cache(config)
        try:
            db = neorest.neorest(config=config,create_indices=False)
        except Exception, e:
            print "UNABLE TO SETUP NEO4J DATABASE!"
            print traceback.format_exc()
            valid_setup = False
    except:
        print "UNABLE TO SET UP CACHE"
        valid_setup = False
except Exception, e:
    print "UNABLE TO PARSE CONFIG FILE:",configfilename
    valid_setup = False

if valid_setup:
    if __name__ == "__main__":
        # Local execution
        wa = webapp(configfilename)
Example #2
0
 def init_db(self,boot=False,in_test_mode=False):
     self.db = neorest.neorest(config=self.config,create_indices=boot,in_test_mode=in_test_mode)