OSDN Git Service

fix vfr.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 18 Dec 2009 04:10:12 +0000 (04:10 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 18 Dec 2009 04:10:12 +0000 (04:10 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@315 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/auto_process.py
rec10/trunk/src/auto_rec.py
rec10/trunk/src/ts2x264.py
rec10/trunk/src/tv2mkv.py
rec10/trunk/src/tv2ts.py
rec10/trunk/src/xml2db.py [deleted file]

index 14929de..a302162 100644 (file)
@@ -6,7 +6,6 @@ import os
 import glob
 import time
 
-import recdb
 import recdblist
 import rec10d
 import os.path
index 3456a64..7ff8909 100644 (file)
@@ -4,7 +4,6 @@
 # Copyright (C) 2009 Yukikaze
 import n_gram
 import rec10d
-import datetime
 def get_db_key(key,chtxt):
     return rec10d.rec10db.select_by_key_in_auto_bayes_key(key, chtxt)
 def change_db_epg(chtxt,beforenum,newnum):
index 5356fc2..75f22b3 100644 (file)
@@ -3,7 +3,6 @@
 # Rec10 TS Recording Tools
 # Copyright (C) 2009 Yukikaze
 import commands
-import os
 import re
 import time
 import tv2avi
index 08e02ef..a341b77 100644 (file)
@@ -2,12 +2,10 @@
 # coding: UTF-8
 # Rec10 TS Recording Tools
 # Copyright (C) 2009 Yukikaze
-import sys
 import commands
 import tv2avi
 import os.path
 import time
-import shutil
 import re
 import recdblist
 import configreader
@@ -55,7 +53,7 @@ def avi2mkv(pin,pout,opt):
         txt=txt+cmdt+"\n"
     if (isvfr==1 and (not os.path.exists(pin.replace(".avi",".120.avi"))) and (not os.path.exists(pout))):
         exes=[]
-        exes.append(doexe = exe + u" -o '" + pout + u"' --cues 0:all --forced-track 0:no --default-duration 0:120000/1001fps -d 0 -A -S '" + pin + u"' --sync 0:0 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0")
+        exes.append(exe + u" -o '" + pout + u"' --cues 0:all --forced-track 0:no --default-duration 0:120000/1001fps -d 0 -A -S '" + pin + u"' --sync 0:0 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0")
         txt=txt+"120fps cfr exection\n"
         try:
             txt=txt+unicode(commands.getoutput(ex.encode('utf-8')),'utf-8')
index d050a2d..44bc95d 100644 (file)
@@ -3,9 +3,7 @@
 #import sys # モジュール属性 argv を取得するため
 import commands
 import os
-import shutil
 import time
-import sys
 
 import configreader
 import status
diff --git a/rec10/trunk/src/xml2db.py b/rec10/trunk/src/xml2db.py
deleted file mode 100644 (file)
index bd20d5d..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009 Yukikaze
-#import sys
-#import os
-import xml.parsers.expat
-import auto_rec
-import chdb
-import rec10d
-import zenhan
-import datetime
-import recdb
-import recdblist
-flags = {}
-lastflag = ""
-xmldate = {}
-db = ""
-bctype = ""
-chlists = []
-tvlists = []
-bayes={}
-dtb=""
-def xml2db(xmlpath, bctypetemp):#bctypeは放送種別で'TE'(地デジ)BS,CSがある。地デジの場合は te数字 が入る
-    global db, bctype
-    bctype = bctypetemp
-    p = xml.parsers.expat.ParserCreate()
-    p.buffer_text = True
-    p.StartElementHandler = start_element
-    p.EndElementHandler = end_element
-    p.CharacterDataHandler = char_data
-    parseDocument(p, xmlpath)
-def writemultitvDB(tvlists):
-    global bctype
-    rec10d.rec10db.new_epg_timeline(bctype)
-    for bctype,channel,start,stop,title,desc,longdesc,category in tvlists:
-        rec10d.rec10db.add_epg_timeline(bctype, channel, start, stop, title, desc, longdesc, category)
-def writemultichDB(chlists):
-    for bctype,ontv,dn in chlists:
-        rec10d.rec10db.update_chname_by_ontv_epg_ch(ontv, dn)
-def parseDocument(p, xmlfile):
-    f = open(xmlfile, 'r')
-    p.ParseFile(f)
-    f.close()
-def start_element(name, attrs):
-    global flags, lastflag, xmldate,dtb
-    flags[name] = 1
-    lastflag = name
-    for (key, val) in attrs.iteritems():
-        xmldate[name + ":" + key] = val
-    dtb=datetime.datetime.now()
-def end_element(name):
-    global flags, lastflag, xmldate, db, chlists, tvlists ,bayes,dtb
-    if flags[name] == 1:
-        if name == "channel":
-            #ubctype = unicode(bctype)
-            #uid = unicode(xmldate['channel:id'])
-            #udn = unicode(xmldate['display-name'])
-            ubctype=bctype
-            uid=xmldate['channel:id']
-            udn=xmldate['display-name']
-            #recdblist.printutf8(uid)
-            bcsearch = None
-            bs = chdb.ontvsearch(xmldate['channel:id'])
-            if bs != None:
-                #recdblist.printutf8(bcsearch)
-                bcsearch = bs['bctype']
-            if ((bcsearch != None) and (bcsearch == bctype)):
-                chlists.append([bctype, uid, udn])
-            xmldate['channel:id'] = ""
-            xmldate['display-name'] = ""
-        elif name == "programme":
-            ubctype=bctype
-            uch=xmldate['programme:channel']
-            ustart=xmldate['programme:start'].replace(" +0900", "")
-            ustop=xmldate['programme:stop'].replace(" +0900", "")
-            utitle=xmldate['title'].replace(",", "-")
-            udesc = xmldate['desc']
-            ulongdesc = xmldate['longdesc']
-            ucategory = xmldate['category']
-
-            
-            tch=chdb.ontvsearch(uch)
-            if tch!=None:
-                if tch.get('bctype',"")==ubctype:
-                    bt=bayes.get(tch['chtxt'],["","",0])
-                    bt2=[bt[0]+utitle+" ",bt[1]+udesc+" "+ulongdesc+" ",bt[2]+1]
-                    bayes[tch['chtxt']]=bt2
-                    tvlists.append([ubctype, uch, ustart, ustop, utitle, udesc,ulongdesc,ucategory])
-                    p=auto_rec.calc_key(tch['chtxt'], utitle, udesc+" "+ulongdesc)
-                    if p>2000:
-                        recdb.add_auto_bayes(tch['chtxt'],utitle, ustart,ustop,p)
-            xmldate['title'] = ""
-            xmldate['desc'] = ""
-            xmldate['longdesc'] = ""
-            xmldate['category'] =""
-        if name == "tv":
-            if len(chlists) > 0:
-                writemultichDB(chlists)
-            chlists = []
-            if len(tvlists) > 0:
-                writemultitvDB(tvlists)
-            tvlists = []
-            for ct,list in bayes.items():
-                auto_rec.update_recall(ct,list[0],list[1],list[2])
-                auto_rec.update_recall("ALL",list[0],list[1],list[2])
-            dtb=datetime.datetime.now()-dtb
-            recdblist.printutf8(bctype + u" epg取り出し終了")
-            recdblist.printutf8(str(dtb.days * 24 * 60 * 60 + dtb.seconds)+u"seconds taken for updating bayes-auto DB .")
-    flags[name] = 0
-def char_data(data):
-    global flags, lastflag, xmldate
-    data = data.replace("\n", "")
-    data = data.replace("  ", "")
-    data = data.replace("\"", "")
-    data = data.replace("\'", "")
-    data = zenhan.toHankaku_ABC123(data)
-    #data = datat.encode('utf-8')
-    if xmldate.has_key(lastflag):
-        if xmldate[lastflag] != data:
-            xmldate[lastflag] += data
-    else:
-        xmldate[lastflag] = data