def executeQuery(self, sql): LogBase.writeTextDaybyDay(self.config['logPath']['sql'], sql, 'sql') cur = self.conn.cursor() cur._defer_warnings = True #cur.execute(sql) self.__clearP() return cur
def execute(self, sql): LogBase.writeTextDaybyDay(self.config['logPath']['sql'], sql, 'sql') cur = self.conn.cursor() cur._defer_warnings = True #cur.execute(sql) self.__clearP() result = {} result['affected_rows'] = cur._result.affected_rows result['insert_id'] = cur._result.insert_id return result
def __writeText(self, path, text): if self.config['print']['logOrErrorPrint']: print(text) LogBase.writeTextDaybyDay(path, text)
def __init__(self): self.config = json.loads(LogBase.readText('./config.json'))
def __writeText(self, path, text): if self.config['print']['logOrErrorPrint']: text = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime( time.time())) + "\t" + str(text) LogBase.writeTextDaybyDay(path, text)