3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2010 Yukikaze
11 def writeRecQue(parentpath,chtxt,title,opts):
12 f=open(os.path.join(parentpath,title+".recq"),"w")
13 optt=opts.replace("E","")
14 optt=optt.replace("D","")
15 optt=optt.replace("R","")
16 str="99"+","+datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+","+configreader.getenv("iff")+","+chtxt+","+title+","+optt
17 f.write(str.encode('utf-8'))
20 def readRecQue(recquepath):
21 f=open(os.path.join(parentpath,title+".recq"),"r")
22 line = unicode(f.readline(),'utf-8')
32 chtxt=linec[2]+u"_"+linec[3]
34 line = unicode(f.readline(),'utf-8')
38 opts=opts.replace("E","")
40 dbkey=recdblist.REC_ENCODE_QUE
41 opts=opts.replace("D","")
43 dbkey=recdblist.REC_TS_DECODE_QUE
44 opts=opts.replace("E","")
45 bt=datetime.datetime.now()+datetime.timedelta(minutes=5)
46 et=bt+datetime.timedelta(minutes=30)
47 btime=bt.strftime("%Y-%m-%d %H:%M:%S")
48 etime=et.strftime("%Y-%m-%d %H:%M:%S")
49 recdb.rec_reckey(dbkey, title, chtxt, btime, etime, opts)