OSDN Git Service

implement recque system.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 30 Oct 2010 06:14:06 +0000 (06:14 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 30 Oct 2010 06:14:06 +0000 (06:14 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@716 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/recque.py

index 898077c..1fe095c 100644 (file)
@@ -22,40 +22,39 @@ def writeRecQue(parentpath,chtxt,title,opts):
     f.close()
 
 def readRecQue(recquepath):
-    if int(time.time()-os.path.getmtime(recquepath))>300:
-        f=open(recquepath,"r")
+    f=open(recquepath,"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
         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
-            line = unicode(f.readline(),'utf-8')
+    dbkey=""
+    if opts.find("E"):
         dbkey=""
-        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)
+        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)
+        dtime = time.time()-os.path.getmtime(file)
         dtime = int(dtime)
         if dtime > 300:
             try: