'configuration:
config=db config .ini file name to parse
config keywords:
dbtype=database type, selects DB API module to load
in conf file use [dbtype] section name instead
host,user,passwd,password,db,database,port will be passed to db module if present
table=db table to use if not specified by a field
insert_param=character to use as parameter placeholder for INSERT
(sqlite3=?, default=%%s)
format_types=types to format before insert (default=x)
(\'s\' to pad strings, \'x\' to convert to hex, \'f\' to format floats, \'fx\' for hex and floats...)'

def __init__(self, *args, **kw):

    self.dbconfig = kw.copy()
    if ('config' in self.dbconfig):
        import ConfigParser
        config = ConfigParser.ConfigParser()
        config.read(self.dbconfig['config'])
        sections = config.sections()
        if (len(sections) > 0):
            self.dbconfig['dbtype'] = sections[0]
            for (k, v) in config.items(sections[0], raw=True):
                self.dbconfig[k] = v
    self.db = __import__(self.dbconfig['dbtype'])
    self.dbconn = self.db.connect(*args, **dict(((k, self.dbconfig[k]) for k in self._DBCONNPARAMS if (k in self.dbconfig))))
    Output.__init__(self, *args, **self.dbconfig)
