'creates a table based on the format string'

def createtable(self, table=None):

    if ((not table) and ('table' in self.dbconfig)):
        table = self.dbconfig['table']
    try:
        cursor = self.dbconn.cursor()
        sqlfields = []
        for (fname, ftype, fspec) in [f for f in self.fields if (f[1] != 'T')]:
            ctype = self.fieldmap[fname][1]
            if ((ctype == 'VARCHAR') and (not fspec)):
                ctype = 'TEXT'
            fdef = ((self.fieldmap[fname][0] + '    ') + ctype)
            if fspec:
                fdef += (('(' + fspec.strip('+-#    lLh').replace('.', ',')) + ')')
            sqlfields.append(fdef)
        sql = (((('CREATE    TABLE    "' + table) + '"    (') + ','.join(sqlfields)) + ')')
        self.log(sql, logging.DEBUG)
        return cursor.execute(sql)
    except:
        raise
