X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=rec10%2Ftrunk%2Fsrc%2Frecque.py;fp=rec10%2Ftrunk%2Fsrc%2Frecque.py;h=898077cafe51b90c0b6c5c62967d7e34151bd9f8;hb=b95d3bb0cb3648a61b4248c2e308350abc5d3a6b;hp=b5c7ad4e860122aedab9e49188ce254c4b8acafa;hpb=22add2d61f065920d40321f0749fcd96b2f60858;p=rec10%2Frec10-git.git diff --git a/rec10/trunk/src/recque.py b/rec10/trunk/src/recque.py index b5c7ad4..898077c 100644 --- a/rec10/trunk/src/recque.py +++ b/rec10/trunk/src/recque.py @@ -22,36 +22,37 @@ def writeRecQue(parentpath,chtxt,title,opts): f.close() def readRecQue(recquepath): - f=open(os.path.join(parentpath,title+".recq"),"r") - line = unicode(f.readline(),'utf-8') - title="" - opts="" - chtxt="" - while line: - linec=line.split(",") - if len(linec)>3: - if linec[0]=="99": - title=linec[4] - opts=linec[5] - chtxt=linec[2]+u"_"+linec[3] - break + if int(time.time()-os.path.getmtime(recquepath))>300: + f=open(recquepath,"r") line = unicode(f.readline(),'utf-8') - dbkey="" - if opts.find("E"): + title="" + opts="" + chtxt="" + while line: + linec=line.split(",") + if len(linec)>3: + if linec[0]=="99": + title=linec[4] + opts=linec[5] + chtxt=linec[2]+u"_"+linec[3] + break + line = unicode(f.readline(),'utf-8') dbkey="" - opts=opts.replace("E","") - if opts.find("D"): - dbkey=recdblist.REC_ENCODE_QUE - opts=opts.replace("D","") - if opts.find("R"): - dbkey=recdblist.REC_TS_DECODE_QUE - opts=opts.replace("E","") - bt=datetime.datetime.now()+datetime.timedelta(minutes=5) - et=bt+datetime.timedelta(minutes=30) - btime=bt.strftime("%Y-%m-%d %H:%M:%S") - etime=et.strftime("%Y-%m-%d %H:%M:%S") - if len(dbkey)>2: - recdb.rec_reckey(dbkey, title, chtxt, btime, etime, opts) + if opts.find("E"): + dbkey="" + opts=opts.replace("E","") + if opts.find("D"): + dbkey=recdblist.REC_ENCODE_QUE + opts=opts.replace("D","") + if opts.find("R"): + dbkey=recdblist.REC_TS_DECODE_QUE + opts=opts.replace("E","") + bt=datetime.datetime.now()+datetime.timedelta(minutes=5) + et=bt+datetime.timedelta(minutes=30) + btime=bt.strftime("%Y-%m-%d %H:%M:%S") + etime=et.strftime("%Y-%m-%d %H:%M:%S") + if len(dbkey)>2: + recdb.rec_reckey(dbkey, title, chtxt, btime, etime, opts) def searchRecQue(folderpath): for file in glob.glob(os.path.join(folderpath,"*.recq")): dtime = time.time()-os.path.getmtime(avipath)