Example #1
0
'''

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")

    (options, args) = parser.parse_args()
Example #2
0
### ---------------------------------------------------------------------------
### 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__':
    main()