values (%s,%s,%s,%s)', \
(chtxt, title, btime, etime))
self.close_db(db)
- def delete_old_auto_timeline_keyword(self, dhour):
+ def delete_old_auto_timeline_bayes(self, dhour):
db = self.connect_db()
db[1].execute("\
- DELETE FROM auto_timeline_keyword \
+ DELETE FROM auto_timeline_bayes \
WHERE \
btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
self.close_db(db)
rec10d.rec10db.add_timeline(type=type, chtxt=chtxt, title=title, btime=btime, etime=etime, opt=opt)
def del_reckey(type, title, chtxt, btime):
rec10d.rec10db.del_timeline(type=type, title=title, chtxt=chtxt, btime=btime)
+def add_auto_keyword(chtxt,title,btime,etime):
+ rec10d.rec10db.add_auto_timeline_keyword(chtxt, title, btime, etime)
+def add_auto_bayes(chtxt,title,btime,etime):
+ rec10d.rec10db.add_auto_timeline_bayes(chtxt, title, btime, etime)
def getnow(dhour):
dhour = int(dhour)
dminutes = 60 * dhour
delete keys except recdb.REC_MISS_ENCODE and recdb.REC_KEYWORD_EVERY_SOME_DAYS before dhour hours from now.
"""
rec10d.rec10db.delete_old_timeline(dhour)
+def delete_old_auto_keyword(dhour):
+ rec10d.rec10db.delete_old_auto_timeline_keyword(dhour)
+def delete_old_auto_bayes(dhour):
+ rec10d.rec10db.delete_old_auto_timeline_bayes(dhour)
def getall():
return rec10d.rec10db.select_all_timeline()
def rec_reclog(title,chtxt,btime,etime,opt,exp,longexp,category):
予定によって子プロセスを生成し処理する。
"""
recdb.delete_old("24")
+ recdb.delete_old_auto_bayes("1")
+ recdb.delete_old_auto_keyword("1")
tasks = recdb.getnow("2")
inum = recdb.countRecNow_minutes("10")
print "番組表更新処理"+ datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
btimet = btt.strftime("%Y-%m-%d %H:%M:%S")
etimet = ett.strftime("%Y-%m-%d %H:%M:%S")
try:
- recdb.rec_reckey(recdb.REC_AUTO_SUGGEST_REC, titlet, chtxtt, btimet, etimet,"")
+ recdb.add_auto_keyword(chtxtt, titlet, btimet, etimet)
except Exception, inst:
print type(inst)
print inst
bayes[tch['chtxt']]=bt2
tvlists.append([ubctype, uch, ustart, ustop, utitle, udesc,ulongdesc,ucategory])
if auto_rec.calc_key(tch['chtxt'], utitle, udesc+" "+ulongdesc):
- recdb.rec_reckey(recdb.REC_BAYES_SUGGEST, utitle, tch['chtxt'], ustart,ustop,"")
+ recdb.add_auto_bayes(utitle, tch['chtxt'], ustart,ustop)
xmldate['title'] = ""
xmldate['desc'] = ""
xmldate['longdesc'] = ""