CREATE TABLE auto_classify \
(\
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
- title VARCHAR(1024),\
- frompath VARCHAR(1024),\
- topath VARCHAR(1024),\
+ title VARCHAR(100),\
+ frompath VARCHAR(400),\
+ topath VARCHAR(400),\
do BOOLEAN,\
- UNIQUE key (title),\
+ UNIQUE key (title)\
)')
except Exception, inst:
if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
def delete_refresh_auto_classify(self):
db = self.connect_db()
db[1].execute("\
- DROP TABLE auto_classify")
+ TRUNCATE TABLE auto_classify")
self.close_db(db)
- self.new_auto_classify()
def delete_old_auto_classify(self, frompath):
db = self.connect_db()
db[1].execute("\
if dbexe > 0:
dls = db[1].fetchall()
self.close_db(db)
- if len(dls)>0:
- return dls[0]
- else:
- return dls
+ return dls
def update_db_to93(self):
db = self.connect_db()
self.drop_in_settings()