3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2013 Yukikaze
10 from decimal import Decimal
17 def __init__(self, dbname, user, passwd, host="localhost", port=3306):
18 warnings.filterwarnings('ignore', "Data truncated for column")
22 self.dbpasswd = passwd
25 con = MySQLdb.connect(user=user, passwd=passwd)
27 cur.execute('CREATE DATABASE ' + dbname + " DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;")
30 except Exception, inst:
31 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
32 recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
33 db = self.connect_db()
36 CREATE TABLE timeline \
38 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
44 deltatime VARCHAR(5),\
47 epgtitle VARCHAR(100),\
50 epgduplicate TINYINT DEFAULT 0,\
51 epgchange TINYINT DEFAULT 0,\
53 epgcategory VARCHAR(100),\
54 counter TINYINT DEFAULT -1,\
55 UNIQUE uni (type,chtxt,title,btime,deltaday)\
57 except Exception, inst:
58 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
59 recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
61 self.new_epg_timeline("")
62 self.new_in_timeline_log()
63 self.new_in_auto_bayes_key()
64 self.new_in_auto_jbk_key()
66 self.new_in_settings()
67 self.new_auto_timeline_bayes()
68 self.new_auto_timeline_keyword()
69 self.new_auto_classify()
74 con = MySQLdb.connect(db=self.dbname, host=self.dbhost, port=self.dbport, user=self.dbusr, passwd=self.dbpasswd, charset="utf8")
80 cur.execute('set names utf8;')
82 def close_db(self, db):
86 db = self.connect_db()
88 db[1].execute('drop table epg_ch')
89 except Exception, inst:
90 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
91 recdblist.addCommonlogEX("Error", "new_epg_ch drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
98 chtxt VARCHAR(20) PRIMARY KEY,\
102 chname VARCHAR(100),\
103 updatetime DATETIME,\
105 visible TINYINT DEFAULT 1,\
112 logoupdate DATETIME,\
113 logostatus TINYINT DEFAULT 2,\
116 except Exception, inst:
117 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
118 recdblist.addCommonlogEX("Error", "new_epg_ch (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
121 def add_epg_ch(self, bctype, chtxt, ch, csch,tsid,updatetime,logoupdate,scanupdate):
122 db = self.connect_db()
124 INSERT INTO epg_ch (bctype,chtxt,ch,csch,tsid,chname,updatetime,status,visible,logoupdate,scanupdate)\
125 VALUES (%s,%s,%s,%s,%s,"",%s,%s,%s,%s,%s)', \
126 (bctype, chtxt, ch, csch,tsid,updatetime, "1","1",logoupdate,scanupdate))
128 def delete_all_epg_ch(self):
129 db = self.connect_db()
133 def select_by_chtxt_epg_ch(self, chtxt):
134 db = self.connect_db()
135 dbexe = db[1].execute("\
136 SELECT bctype,chtxt,ch,csch,tsid,updatetime,chname,status,visible,logoupdate,scanupdate \
138 WHERE chtxt LIKE %s", \
143 dls = db[1].fetchall()
147 r[5] = r[5].strftime("%Y-%m-%d %H:%M:%S")
149 r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
151 r[9]="2012-04-01 00:00:00"
152 r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
155 def select_by_bctype_epg_ch(self, bctype):
156 db = self.connect_db()
157 dbexe = db[1].execute("\
158 SELECT bctype,chtxt,ch,csch,tsid,updatetime,status,chname,status,visible,logoupdate,scanupdate \
160 WHERE bctype = %s", \
165 dls = db[1].fetchall()
168 #recdblist.printutf8(dl)
170 r[5] = r[5].strftime("%Y-%m-%d %H:%M:%S")
172 r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
174 r[10]="2011-04-01 00:00:00"
175 r[11] = r[11].strftime("%Y-%m-%d %H:%M:%S")
179 ret.insert(0,ret[random.randint(0,len(ret)-1)])
181 def select_by_ch_epg_ch(self, ch):
182 db = self.connect_db()
183 dbexe = db[1].execute("\
185 bctype,chtxt,ch,csch,tsid,updatetime,chname,status,visible,logoupdate,scanupdate \
192 dls = db[1].fetchall()
196 r[5] = r[5].strftime("%Y-%m-%d %H:%M:%S")
197 r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
198 r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
201 def select_by_csch_epg_ch(self, csch):
202 db = self.connect_db()
203 dbexe = db[1].execute("\
205 bctype,chtxt,ch,csch,tsid,updatetime,chname,status,visible,logoupdate,scanupdate \
212 dls = db[1].fetchall()
216 r[5] = r[5].strftime("%Y-%m-%d %H:%M:%S")
217 r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
218 r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
221 def select_all_epg_ch(self):
222 db = self.connect_db()
223 dbexe = db[1].execute("\
224 SELECT bctype,chtxt,ch,csch,tsid,updatetime,chname,status,visible,logoupdate,scanupdate \
230 dls = db[1].fetchall()
234 r[5] = r[5].strftime("%Y-%m-%d %H:%M:%S")
235 r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
236 r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
239 def change_visible_epg_ch(self,chtxt,visible):
240 db = self.connect_db()
242 UPDATE epg_ch SET visible=%s WHERE chtxt=%s",(visible,chtxt))
244 def change_logodata_epg_ch(self,chtxt,logonum,logodata):
245 db = self.connect_db()
247 UPDATE epg_ch SET logo"+str(logonum)+"=%s WHERE chtxt=%s",(logodata,chtxt))
249 def set_new_status(self,dhour):
250 db = self.connect_db()
251 dbexe = db[1].execute("UPDATE epg_ch \
255 updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
260 def select_get_update_epg_ch(self, dhour):
261 db = self.connect_db()
262 dbexe = db[1].execute("SELECT bctype,chtxt,status FROM epg_ch \
265 updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
271 ORDER BY status DESC")
273 #recdblist.printutf8(dbexe)
275 ret = db[1].fetchall()
278 def select_get_updatelogo_epg_ch(self, dhour):
279 db = self.connect_db()
280 dbexe = db[1].execute("SELECT bctype,chtxt,logostatus FROM epg_ch \
283 updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
289 ORDER BY status DESC")
291 #recdblist.printutf8(dbexe)
293 ret = db[1].fetchall()
296 def update_by_bctype_epg_ch(self, bctype):
297 db = self.connect_db()
303 WHERE bctype = %s", (bctype,))
306 def update_by_bctype_and_chtxt_epg_ch(self, bctype, chtxt):
307 db = self.connect_db()
313 WHERE bctype = %s AND chtxt = %s", (bctype, chtxt))
315 def update_chname_by_chtxt_epg_ch(self,chtxt,chname):
316 db = self.connect_db()
321 WHERE chtxt = %s", (chname,chtxt))
323 def update_status_by_bctype_epg_ch(self, bctype, status):
324 db = self.connect_db()
330 WHERE bctype = %s", \
334 def update_logostatus_by_bctype_epg_ch(self,bctype,logostatus):
335 db = self.connect_db()
341 WHERE bctype = %s", \
342 (logostatus, bctype)\
345 def add_auto_proc_tmp(self,type,title,chtxt):
346 db = self.connect_db()
348 INSERT IGNORE into auto_proc_tmp \
350 values (%s,%s,%s)',(type,title,chtxt))
353 def new_auto_proc_tmp(self):
354 db = self.connect_db()
356 db[1].execute('drop table auto_proc_tmp')
357 except Exception, inst:
358 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
359 recdblist.addCommonlogEX("Error", "new_auto_proc_tmp drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
363 CREATE TABLE auto_proc_tmp \
366 title VARCHAR(100) PRIMARY KEY,\
368 UNIQUE unibayeskey(title)\
370 except Exception, inst:
371 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
372 recdblist.addCommonlogEX("Error", "new_auto_proc_tmp (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
375 def update_auto_proc(self):
376 db = self.connect_db()
378 db[1].execute('INSERT INTO auto_proc SELECT * FROM auto_proc_tmp')
379 except Exception, inst:
380 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
381 recdblist.addCommonlogEX("Error", "update_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
384 def new_auto_proc(self):
385 db = self.connect_db()
387 db[1].execute('drop table auto_proc')
388 except Exception, inst:
389 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
390 recdblist.addCommonlogEX("Error", "new_auto_proc drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
394 CREATE TABLE auto_proc \
397 title VARCHAR(100) PRIMARY KEY,\
399 UNIQUE unibayeskey(title)\
401 except Exception, inst:
402 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
403 recdblist.addCommonlogEX("Error", "new_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
406 def add_auto_proc(self,type,title,chtxt):
407 db = self.connect_db()
409 INSERT IGNORE into auto_proc \
411 values (%s,%s,%s)',(type,title,chtxt))
414 def drop_in_settings(self):
415 db = self.connect_db()
417 db[1].execute('drop table in_settings')
418 except Exception, inst:
419 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
420 recdblist.addCommonlogEX("Error", "drop_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
422 def new_in_settings(self):
423 db = self.connect_db()
426 CREATE TABLE in_settings \
430 auto_opt VARCHAR(20),\
431 auto_del_tmp TINYINT\
433 db[1].execute("INSERT IGNORE into in_settings VALUE (0,0,\"H\",1)")
434 except Exception, inst:
435 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
436 recdblist.addCommonlogEX("Error", "new_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
439 def select_all_in_settings(self):
440 db = self.connect_db()
441 dbexe = db[1].execute("\
442 SELECT auto_jbk,auto_bayes,auto_del_tmp,auto_opt \
448 dls = db[1].fetchall()
458 def add_in_timeline_log(self , chtxt="", title="", btime="", etime="", opt="", exp="", longexp="", category=""):
459 db = self.connect_db()
461 INSERT IGNORE into in_timeline_log \
462 (chtxt,title,btime,etime,opt,exp,longexp,category) \
463 values (%s,%s,%s,%s,%s,%s,%s,%s)', \
464 ( chtxt, title, btime, etime, opt,exp,longexp,category))
467 def del_in_timeline_log(self, title="", chtxt="", btime=""):
471 db = self.connect_db()
473 DELETE FROM in_timeline_log \
474 WHERE title = %s AND chtxt = %s AND btime = %s", \
475 (title, chtxt, btime))
478 def new_in_timeline_log(self):
479 db = self.connect_db()
482 CREATE TABLE in_timeline_log \
484 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
492 category VARCHAR(100),\
493 UNIQUE uni (chtxt,title,btime,category)\
495 except Exception, inst:
496 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
497 recdblist.addCommonlogEX("Error", "new_in_timeline_log (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
500 def select_chtxt_by_title_timeline_log(self,title):
501 db = self.connect_db()
502 dbexe = db[1].execute("\
504 FROM in_timeline_log \
505 WHERE title LIKE \"%"+title+"%\"\
507 ORDER by sum(1) DESC limit 1")
508 retdb=db[1].fetchall()
515 def add_timeline(self, type="", chtxt="", title="", btime="", etime="", deltatime="", deltaday="", opt="" ,counter=-1):
516 db = self.connect_db()
518 INSERT IGNORE into timeline \
519 (type,chtxt,title,btime,etime,deltatime,deltaday,opt,counter) \
520 values (%s,%s,%s,%s,%s,%s,%s,%s,%s)', \
521 (type, chtxt, title, btime, etime, deltatime, deltaday, opt ,counter))
524 def update_epg_timeline(self,type,chtxt,title,btime,epgbtime,epgetime,epgtitle,epgexp,epgcategory):
525 db = self.connect_db()
528 SET epgbtime=%s,epgetime=%s,epgtitle=%s,epgexp=%s,epgcategory=%s \
529 WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
530 (epgbtime,epgetime,epgtitle,epgexp,epgcategory,type, chtxt, title, btime))
533 def update_status_change_timeline(self,type,chtxt,title,btime,epgchange):
534 db = self.connect_db()
538 WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
539 (epgchange , type, chtxt, title, btime))
542 def update_status_dup_timeline(self,type,chtxt,title,btime,epgduplicate):
543 db = self.connect_db()
546 SET epgduplicate =%s \
547 WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
548 (epgduplicate , type, chtxt, title, btime))
551 def del_timeline(self, type="", title="", chtxt="", btime=""):
555 db = self.connect_db()
557 DELETE FROM timeline \
558 WHERE type = %s AND title = %s AND chtxt = %s AND btime = %s", \
559 (type, title, chtxt, btime))
562 def select_all_timeline(self):
563 db = self.connect_db()
565 dbr = db[1].execute("\
566 SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
568 dbl = db[1].fetchall()
571 recdata = self.getdic_timeline(dbl)
573 def select_bytime_timeline(self, dminutes):
574 db = self.connect_db()
576 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
577 dbr = db[1].execute("SELECT \
578 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
580 WHERE btime BETWEEN DATE_SUB(now(),INTERVAL " + dminutes + " MINUTE ) AND \
581 DATE_ADD(now(),INTERVAL " + dminutes + " MINUTE )")
582 dbl = db[1].fetchall()
584 #recdblist.printutf8(dbl)
586 recdatum = self.getdic_timeline(dbl)
588 def select_by_name_time_timeline(self,title,btime,btime2):
589 db = self.connect_db()
591 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
592 dbr = db[1].execute("SELECT \
593 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
595 WHERE btime > %s AND \
596 btime < %s AND title = %s",(btime,btime2,title))
597 dbl = db[1].fetchall()
599 #recdblist.printutf8(dbl)
601 recdatum = self.getdic_timeline(dbl)
603 def select_bytime_all_timeline(self,btime,etime):
604 db = self.connect_db()
606 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
607 dbr = db[1].execute("SELECT \
608 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
610 WHERE btime >= %s AND \
611 etime <= %s",(btime,etime))
612 dbl = db[1].fetchall()
614 #recdblist.printutf8(dbl)
616 recdatum = self.getdic_timeline(dbl)
618 def select_byepgtime_all_timeline(self,epgbtime,epgetime):
619 db = self.connect_db()
621 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
622 dbr = db[1].execute("SELECT \
623 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
625 WHERE epgbtime >= %s AND \
626 epgetime <= %s",(epgbtime,epgetime))
627 dbl = db[1].fetchall()
629 #recdblist.printutf8(dbl)
631 recdatum=self.getdic_timeline(dbl)
633 def select_byepgtime_over_timeline(self,epgbtime,epgetime):
634 db = self.connect_db()
636 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
637 dbr = db[1].execute("SELECT \
638 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
640 WHERE (NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s )))"\
641 ,(epgbtime,epgetime))
642 dbl = db[1].fetchall()
644 #recdblist.printutf8(dbl)
646 recdatum=self.getdic_timeline(dbl)
648 def count_schedule_timeline(self, btime, etime):
651 return [te num,bs/cs num]
653 db = self.connect_db()
654 dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
655 dbexe = dbexe + " WHERE ((NOT(( timeline.etime <= %s )OR( timeline.btime >= %s ))) OR ((timeline.btime = %s) AND (timeline.etime = %s) ) )"
658 db[1].execute(dbexe, (btime, etime,btime,etime))
660 for typet, bctypet, chtxtt, titlet in dbl:
661 if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
662 if bctypet.find("cs") > -1:
664 elif bctypet.find("bs") > -1:
666 elif bctypet.find("te") > -1:
670 def search_schedule_timeline(self,btime,etime):
673 return [(type,bctype,chtxt,title,btime,etime)]
675 db = self.connect_db()
676 dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title,timeline.btime,timeline.etime FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
677 dbexe = dbexe + " WHERE ((NOT(( timeline.etime <= %s )OR( timeline.btime >= %s ))) OR ((timeline.btime = %s) AND (timeline.etime = %s) ) )"
679 db[1].execute(dbexe, (btime, etime,btime,etime))
681 for typet, bctypet, chtxtt, titlet , btimet, etimet in dbl:
682 if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
683 ret.append([typet,bctypet,chtxtt,titlet,btimet,etimet])
686 def count_epgschedule_timeline(self, epgbtime, epgetime):
689 return [te num,bs/cs num]
691 db = self.connect_db()
692 dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
693 dbexe = dbexe + " WHERE (NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s )))"
696 db[1].execute(dbexe, (epgbtime, epgetime))
698 for typet, bctypet, chtxtt, titlet in dbl:
699 if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
700 if bctypet.find("cs") > -1:
702 elif bctypet.find("bs") > -1:
704 elif bctypet.find("te") > -1:
708 def search_epgschedule_timeline(self,epgbtime,epgetime):
711 return [(type,bctype,chtxt,title,btime,etime)]
713 db = self.connect_db()
714 dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title,timeline.btime,timeline.etime FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
715 dbexe = dbexe + " WHERE ((NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s ))) OR ((timeline.epgbtime = %s) AND (timeline.epgetime = %s) ) )"
717 db[1].execute(dbexe, (epgbtime, epgetime,epgbtime,epgetime))
719 for typet, bctypet, chtxtt, titlet , btimet, etimet in dbl:
720 if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
721 ret.append([typet,bctypet,chtxtt,titlet,btimet,etimet])
724 def select_bytime_bychtxt_all_timeline(self,btime,etime,chtxt):
725 db = self.connect_db()
727 #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
728 dbr = db[1].execute("SELECT \
729 type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
731 WHERE btime > %s AND \
733 AND chtxt=%s ",(btime,etime,chtxt))
734 dbl = db[1].fetchall()
736 #recdblist.printutf8(dbl)
738 recdatum = self.getdic_timeline(dbl)
740 def getdic_timeline(self,timelinelists):
742 for typet, chtxt, title, btime, etime, deltatime, deltaday, opt ,epgbtimet , epgetimet ,epgtitlet ,epgduplicatet ,epgchanget ,countert in timelinelists:
747 btime = btime.strftime("%Y-%m-%d %H:%M:%S")
748 etime = etime.strftime("%Y-%m-%d %H:%M:%S")
753 ret['epgbtime'] = epgbtimet.strftime("%Y-%m-%d %H:%M:%S")
754 ret['epgetime'] = epgetimet.strftime("%Y-%m-%d %H:%M:%S")
756 ret['epgbtime'] = "2010-01-01 00:00:00"
757 ret['epgetime'] = "2010-01-01 00:00:00"
758 ret['epgtitle'] = epgtitlet
759 ret['epgduplicate'] = epgduplicatet
760 ret['epgchange'] = epgchanget
761 if deltatime == None or deltatime == "":
763 if deltaday == None or deltaday == "":
765 if typet == recdblist.REC_KEYWORD:
766 ret['deltatime'] = deltatime
767 elif typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS:
768 ret['deltatime'] = deltatime
769 ret['deltaday'] = deltaday
771 ret['counter'] = int(countert)
776 def delete_old_timeline(self, dhour):
777 db = self.connect_db()
779 DELETE FROM timeline \
781 btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
784 def new_in_auto_jbk_key(self):
785 db = self.connect_db()
788 CREATE TABLE in_auto_jbk_key \
790 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
791 keyword VARCHAR(200),\
792 auto TINYINT DEFAULT 0,\
794 UNIQUE unijbk (keyword)\
796 except Exception, inst:
797 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
798 recdblist.addCommonlogEX("Error", "new_in_auto_jbk_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
800 def add_in_auto_jbk_key(self,key):
801 db = self.connect_db()
803 INSERT IGNORE into in_auto_jbk_key \
809 def select_all_in_auto_jbk_key(self):
810 db = self.connect_db()
811 dbexe = db[1].execute("\
812 SELECT keyword,auto,opt \
813 FROM in_auto_jbk_key \
817 ret = db[1].fetchall()
820 def drop_in_status(self):
821 db = self.connect_db()
823 db[1].execute('drop table in_status')
824 except Exception, inst:
825 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
826 recdblist.addCommonlogEX("Error", "drop_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
828 def new_in_status(self):
829 db = self.connect_db()
832 CREATE TABLE in_status \
834 ts2avi TINYINT DEFAULT 0,\
835 terec TINYINT DEFAULT 0,\
836 bscsrec TINYINT DEFAULT 0,\
837 b252ts TINYINT DEFAULT 0,\
838 installed TINYINT DEFAULT 0,\
841 db[1].execute("INSERT IGNORE into in_status VALUE (0,0,0,0,0,0)")
842 except Exception, inst:
843 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
844 recdblist.addCommonlogEX("Error", "new_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
846 def select_all_in_status(self):
847 db = self.connect_db()
848 dbexe = db[1].execute("\
849 SELECT ts2avi,terec,bscsrec,b252ts \
855 dls = db[1].fetchall()
865 def select_version_in_status(self):
866 db = self.connect_db()
869 dbexe = db[1].execute("\
874 dls = db[1].fetchall()
878 version=int(str(r[0]))
879 except Exception, inst:
880 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
881 recdblist.addCommonlogEX("Error", "select_version_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
883 def change_version_in_status(self,version):
884 db = self.connect_db()
886 UPDATE in_status SET version=%s",str(version))
888 def change_ts2avi_in_status(self,i):
893 db = self.connect_db()
895 UPDATE in_status SET ts2avi=ts2avi+%s",i)
897 def change_terec_in_status(self,i):
902 db = self.connect_db()
904 UPDATE in_status SET terec=terec+%s",i)
906 def change_bscsrec_in_status(self,i):
911 db = self.connect_db()
913 UPDATE in_status SET bscsrec=bscsrec+%s",i)
915 def change_b252ts_in_status(self,i):
920 db = self.connect_db()
922 UPDATE in_status SET b252ts=b252ts+%s",i)
924 def select_installed_in_status(self):
925 db = self.connect_db()
926 dbexe = db[1].execute("\
927 SELECT ts2avi,terec,bscsrec,b252ts,installed \
933 dls = db[1].fetchall()
939 def change_chscaned_in_status(self):
943 db = self.connect_db()
945 UPDATE in_status SET installed=2")
947 def change_installed_in_status(self,num=1):
951 db = self.connect_db()
953 UPDATE in_status SET installed=%s",(num,))
955 def new_epg_timeline(self, bctype):
956 db = self.connect_db()
959 DELETE FROM epg_timeline \
960 WHERE bctype = %s", \
962 except Exception, inst:
963 if not ((type(inst)==MySQLdb.ProgrammingError and (inst[0]==1007 or inst[0]==1146))or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
964 recdblist.addCommonlogEX("Error", "new_epg_timeline delete (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
967 CREATE TABLE epg_timeline \
970 channel VARCHAR(100) NOT NULL,\
976 category VARCHAR(100),\
977 UNIQUE unitv(bctype,channel,start,stop,title)\
979 except Exception, inst:
980 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
981 recdblist.addCommonlogEX("Error", "new_epg_timeline (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
984 def add_epg_timeline(self, bctype, channel, start, stop, title, desc,longdesc, category):
985 db = self.connect_db()
987 INSERT IGNORE INTO epg_timeline \
988 VALUES (%s,%s,%s,%s,%s,%s,%s,%s)', \
989 (bctype, channel, start, stop, title, desc,longdesc,category))
992 def add_multi_epg_timeline(self, tvlists):
994 tvlists is (bctype,channel,start,stop,title,desc,longdesc,category) lists.
996 db = self.connect_db()
998 INSERT IGNORE INTO epg_timeline \
999 (bctype,channel,start,stop,title,exp,longexp,category) \
1000 values(%s,%s,%s,%s,%s,%s,%s,%s)', \
1003 def select_by_time_ngram_epg_timeline(self, btime, etime, chtxt):
1004 db = self.connect_db()
1007 channel,title,start,stop,exp,longexp,category \
1014 dbcmd = db[1].execute(dbexe, (btime, etime, chtxt))
1017 retall = db[1].fetchall()
1020 def select_by_time_keyword_auto_suggest_epg_timeline(self,keyword,btime,etime):
1021 db = self.connect_db()
1024 epg_ch.chtxt,title,start,stop,exp,longexp,category \
1027 WHERE epg_ch.chtxt=epg_timeline.channel \
1036 ( title LIKE \'%%"+keyword+"%%\' ) \
1038 ( exp LIKE \'%%"+keyword+"%%\' ) \
1040 ( longexp LIKE \'%%"+keyword+"%%\' ) \
1042 dbcmd = db[1].execute(dbexe,(btime, etime))
1045 retall = db[1].fetchall()
1048 def new_in_auto_bayes_key(self):
1049 db = self.connect_db()
1051 db[1].execute('CREATE TABLE in_auto_bayes_key \
1053 keychar VARCHAR(10),\
1055 ratio_rec DECIMAL(32,14),\
1056 ratio_all DECIMAL(32,14),\
1057 UNIQUE unibayeskey(keychar,chtxt)\
1059 db[1].execute('CREATE INDEX keycharindex ON in_auto_bayes_key(keychar)')
1060 except Exception, inst:
1061 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1062 recdblist.addCommonlogEX("Error", "new_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1065 def add_in_auto_bayes_key(self,key,chtxt,ratio_rec,ratio_all):
1066 db = self.connect_db()
1067 ratio_rec=str(ratio_rec)
1068 ratio_all=str(ratio_all)
1070 INSERT IGNORE INTO in_auto_bayes_key \
1071 (keychar,chtxt,ratio_rec,ratio_all) \
1072 values (%s,%s,%s,%s)',\
1073 (key,chtxt,ratio_rec,ratio_all))
1075 def add_num_in_auto_bayes_key(self,chtxt,add_rec_num,add_all_num):
1076 db = self.connect_db()
1077 add_rec_num=str(add_rec_num)
1078 add_all_num=str(add_all_num)
1080 UPDATE in_auto_bayes_key SET ratio_rec=CONVERT(ratio_rec+%s,DECIMAL(32,14)),ratio_all=CONVERT(ratio_all+%s,DECIMAL(32,14)) WHERE keychar=\"NUM\" AND chtxt=%s",\
1081 (add_rec_num,add_all_num,chtxt))
1083 def change_in_auto_bayes_key(self,key,chtxt,new_ratio_rec,new_ratio_all):
1086 db = self.connect_db()
1088 UPDATE in_auto_bayes_key SET ratio_rec=%s,ratio_all=%s WHERE keychar=%s AND chtxt=%s",(str(new_ratio_rec),str(new_ratio_all),key,chtxt)\
1091 def change_ratio_all_reduce_in_auto_bayes_key(self,chtxt,beforenum,newnum):
1092 beforenum=str(beforenum)
1094 db = self.connect_db()
1096 UPDATE in_auto_bayes_key SET ratio_all=CONVERT(ratio_all*%s/(%s+%s),DECIMAL(32,14)) WHERE chtxt=%s AND NOT (keychar=\"NUM\")",(beforenum,newnum,beforenum,chtxt)\
1099 def change_ratio_all_in_auto_bayes_key(self,key,chtxt,beforenum,addnum):
1100 db = self.connect_db()
1101 beforenumf=beforenum
1102 beforenum=str(beforenum)
1103 db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
1104 VALUES (%s,%s,%s,%s)\
1105 ON DUPLICATE KEY UPDATE \
1106 ratio_all=CONVERT((ratio_all*%s+%s)/%s,DECIMAL(32,14))",(key,chtxt,"0",str(Decimal(addnum)/beforenumf),beforenum,chtxt,key))
1108 def change_multi_ratio_all_in_auto_bayes_key(self,chtxt,beforenum,list):
1110 list={key:addnum}のリスト
1112 beforenumf=beforenum
1113 beforenum=str(beforenum)
1114 db = self.connect_db()
1115 for i,j in list.items():
1116 retl=(i,chtxt,"0",str(Decimal(j)/beforenumf),beforenum,str(j),beforenum)
1118 db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
1119 VALUES (%s,%s,%s,%s)\
1120 ON DUPLICATE KEY UPDATE \
1121 ratio_all=CONVERT((ratio_all*%s+%s)/%s,DECIMAL(32,14))",retl)
1122 except Exception, inst:
1123 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1124 recdblist.addCommonlogEX("Error", "change_multi_ratio_all_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1126 def change_ratio_rec_reduce_in_auto_bayes_key(self,chtxt,beforenum,newnum):
1127 beforenum=str(beforenum)
1129 db = self.connect_db()
1131 UPDATE in_auto_bayes_key SET ratio_rec=CONVERT(ratio_rec*%s/(%s+%s),DECIMAL(32,14)) WHERE chtxt=%s AND NOT (keychar=\"NUM\")",(beforenum,newnum,beforenum,chtxt)\
1134 def change_ratio_rec_in_auto_bayes_key(self,key,chtxt,beforenum,addnum):
1135 db = self.connect_db()
1136 beforenumf=beforenum
1137 beforenum=str(beforenum)
1138 db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
1139 VALUES (%s,%s,%s,%s)\
1140 ON DUPLICATE KEY UPDATE \
1141 ratio_rec=CONVERT((ratio_rec*%s+%s)/%s,DECIMAL(32,14))",(key,chtxt,str(Decimal(addnum)/beforenumf),"0",beforenum,chtxt,key))
1143 def change_multi_ratio_rec_in_auto_bayes_key(self,chtxt,beforenum,list):#self,key,chtxt,beforenum,addnum):
1144 beforenumf=beforenum
1145 beforenum=str(beforenum)
1146 db = self.connect_db()
1147 for i,j in list.items():
1148 retl=(i,chtxt,str(Decimal(j)/beforenumf),"0",beforenum,str(j),beforenum)
1150 db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
1151 VALUES (%s,%s,%s,%s)\
1152 ON DUPLICATE KEY UPDATE \
1153 ratio_rec=CONVERT((ratio_rec*%s+%s)/%s,DECIMAL(32,14))",retl)
1154 except Exception, inst:
1155 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1156 recdblist.addCommonlogEX("Error", "change_multi_ratio_rec_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1158 def select_by_key_in_auto_bayes_key(self,key,chtxt):
1159 db = self.connect_db()
1160 dbexe = db[1].execute("\
1161 SELECT keychar,chtxt,ratio_rec,ratio_all \
1162 FROM in_auto_bayes_key \
1163 WHERE keychar = %s AND chtxt = %s", \
1167 dls = db[1].fetchall()
1173 def new_auto_timeline_keyword(self):
1174 db = self.connect_db()
1177 CREATE TABLE auto_timeline_keyword \
1179 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
1181 title VARCHAR(100),\
1184 UNIQUE uni (chtxt,title,btime,etime)\
1186 except Exception, inst:
1187 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1188 recdblist.addCommonlogEX("Error", "new_auto_timeline_keyword (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1189 def add_auto_timeline_keyword(self,chtxt="", title="", btime="", etime=""):
1190 db = self.connect_db()
1192 INSERT IGNORE into auto_timeline_keyword \
1193 (chtxt,title,btime,etime) \
1194 values (%s,%s,%s,%s)', \
1195 (chtxt, title, btime, etime))
1198 def delete_old_auto_timeline_keyword(self, dhour):
1199 db = self.connect_db()
1201 DELETE FROM auto_timeline_keyword \
1203 btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
1205 def new_auto_timeline_bayes(self):
1206 db = self.connect_db()
1209 CREATE TABLE auto_timeline_bayes \
1211 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
1213 title VARCHAR(100),\
1217 UNIQUE uni (chtxt,title,btime,etime)\
1219 except Exception, inst:
1220 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1221 recdblist.addCommonlogEX("Error", "new_auto_timeline_bayes (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1222 def add_auto_timeline_bayes(self,chtxt="", title="", btime="", etime="",point=""):
1223 db = self.connect_db()
1225 INSERT IGNORE into auto_timeline_bayes \
1226 (chtxt,title,btime,etime,point) \
1227 values (%s,%s,%s,%s,%s)', \
1228 (chtxt, title, btime, etime,point))
1230 def delete_old_auto_timeline_bayes(self, dhour):
1231 db = self.connect_db()
1233 DELETE FROM auto_timeline_bayes \
1235 btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
1237 def new_auto_classify(self):
1238 db = self.connect_db()
1241 CREATE TABLE auto_classify \
1243 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
1244 title VARCHAR(1024),\
1245 frompath VARCHAR(1024),\
1246 topath VARCHAR(1024),\
1249 except Exception, inst:
1250 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
1251 recdblist.addCommonlogEX("Error", "new_auto_classify (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
1252 def add_auto_classify(self,title="", frompath="", topath=""):
1253 db = self.connect_db()
1255 INSERT IGNORE into auto_classify \
1256 (title,frompath,topath,do) \
1257 values (%s,%s,%s,0)', \
1258 (title,frompath, topath))
1260 def delete_old_auto_classify(self, frompath):
1261 db = self.connect_db()
1263 DELETE FROM auto_classify \
1265 frompath == %s", (frompath))
1267 def select_move_auto_classify(self):
1268 db = self.connect_db()
1269 dbexe = db[1].execute("\
1270 SELECT id,title,frompath,topath \
1271 FROM auto_classify \
1275 dls = db[1].fetchall()
1281 def update_db_to93(self):
1282 db = self.connect_db()
1283 self.drop_in_settings()
1284 self.new_in_settings()
1286 ALTER TABLE timeline ADD epgtitle VARCHAR(100),\
1287 ADD epgbtime DATETIME,\
1288 ADD epgetime DATETIME,\
1289 ADD epgduplicate TINYINT DEFAULT 0,\
1290 ADD epgchange TINYINT DEFAULT 0")
1292 ALTER TABLE in_status ADD version TINYINT")
1294 self.change_version_in_status("93")
1295 def update_db_93to94(self):
1296 db = self.connect_db()
1297 self.drop_in_settings()
1298 self.new_in_settings()
1300 ALTER TABLE timeline ADD counter TINYINT DEFAULT -1")
1302 self.change_version_in_status("94")
1303 def update_db_94to95(self):
1304 db = self.connect_db()
1305 self.drop_in_settings()
1306 self.new_in_settings()
1308 ALTER TABLE timeline ADD epgexp VARCHAR(200)")
1310 self.change_version_in_status("95")
1311 def update_db_95to96(self):
1312 db = self.connect_db()
1313 self.drop_in_settings()
1314 self.new_in_settings()
1316 self.change_version_in_status("96")
1317 def update_db_96to98(self):
1318 db = self.connect_db()
1319 self.drop_in_settings()
1320 self.new_in_settings()
1322 self.change_version_in_status("98")
1323 def update_db_98to100(self):
1324 ###ここで前のepg_chをバックアップしてchtxtの変換をする必要がある。
1325 self.drop_in_settings()
1326 self.new_in_settings()
1327 db = self.connect_db()
1329 UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT(CONCAT(epg_ch.ch,'_'),epg_ch.csch) WHERE NOT (substring(epg_ch.bctype,1,2) = 'bs' OR substring(epg_ch.bctype,1,2) = 'cs')")
1331 UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('BS_',epg_ch.ch) WHERE substring(epg_ch.bctype,1,2) = 'bs'")
1333 UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('CS_',epg_ch.csch) WHERE substring(epg_ch.bctype,1,2) = 'cs'")
1336 ALTER TABLE epg_ch DROP ontv")
1340 ALTER TABLE epg_ch ADD logo0 BLOB,\
1348 ALTER TABLE in_auto_jbk_key ADD auto TINYINT DEFAULT 0")
1350 ALTER TABLE in_auto_jbk_key ADD opt VARCHAR(20) DEFAULT \"\"")
1352 self.change_installed_in_status(1)#チャンネルスキャンをさせる
1353 self.change_version_in_status("100")
1354 def update_db_100to101(self):
1355 self.drop_in_settings()
1356 self.new_in_settings()
1358 db = self.connect_db()
1361 ALTER TABLE timeline ADD epgcategory VARCHAR(100)\
1366 self.change_installed_in_status(1)
1367 self.change_version_in_status("101")
1368 #self.change_installed_in_status()#チャンネルスキャンをさせる
1369 def update_db_101to102(sekf):
1370 self.drop_in_settings()
1371 self.new_in_settings()
1373 db = self.connect_db()
1376 ALTER TABLE epg_ch ADD tsid VARCHAR(20)\
1381 self.change_installed_in_status(1)
1382 self.change_version_in_status("102")
1383 #self.change_installed_in_status()#チャンネルスキャンをさせる
1384 def update_db_102to103(sekf):
1385 self.drop_in_settings()
1386 self.new_in_settings()
1388 self.new_auto_classify()
1390 self.change_installed_in_status(1)
1391 self.change_version_in_status("103")
1392 #self.change_installed_in_status()#チャンネルスキャンをさせる