Copyright (c) 2009 Wellcome Trust Sanger Institute. All rights reserved. ''' import os from genepy import util import sys import loaders.db as db import ropy.util import ropy.query from optparse import OptionParser from ropy.log import LogSetup ### --------------------------------------------------------------------------- ### Logging setup ### --------------------------------------------------------------------------- logsetup = LogSetup() logsetup.logname = "genepy-multiloader" logsetup.logpath = "%s/logs.txt" % os.path.realpath(os.path.dirname(__file__)) logsetup.setupLogging() logger = logsetup.logger ### --------------------------------------------------------------------------- ### main ### --------------------------------------------------------------------------- def main(): usage = "usage: %prog [Options]" parser = OptionParser(usage=usage) parser.add_option("-l", "--list", metavar="FILE", help="FILE containing the list of all organism common names and its associated file to load", action="store", type="string", dest="list") parser.add_option("-D", action="store", dest="dbhost")
### --------------------------------------------------------------------------- ### Database Setup ### --------------------------------------------------------------------------- host=config.get('Connection', 'host') database=config.get('Connection', 'database') user=config.get('Connection', 'user') password=config.get('Connection', 'password') connectionFactory = ConnectionFactory(host, database, user, password) ### --------------------------------------------------------------------------- ### Log Setup ### --------------------------------------------------------------------------- try: logsetup = LogSetup() logsetup.logname = "genepy" logsetup.logpath = config.get('Logging', 'path') logsetup.setupLogging() logger = logsetup.logger except Exception, e: print e print "Could not set up the logging, is the path set in the configuration file correct?" sys.exit(1) ### --------------------------------------------------------------------------- def main(): pass if __name__ == '__main__':