OSDN Git Service

fix LANG.
[rec10/rec10-git.git] / rec10 / trunk / src / recording_earth_pt1.py
index 9806930..caf28e7 100644 (file)
@@ -72,14 +72,13 @@ def getActiveAdapter(channel):
             return str(i)
 def record(channel,tsid,out,timelength,decode=1):
     if not os.path.exists(tmppath+u"rec.sh"):
-        ft=open(tmppath+u"rec.sh")
+        ft=open(tmppath+u"rec.sh","w")
         ft.write(u"#!/bin/bash\n/bin/cat $1 > $2")
         ft.close()
         os.system(u"chmod +x "+tmppath+u"rec.sh")
     adapt=getActiveAdapter(channel)
     my_env=recdblist.getEnv()
     if adapt!=None:
-        f=open(out,"w")
         tunecmd=configreader.getConfDVB("DVBtune")+u" "+adapt+u" "+channel2freq(channel)+u" "+tsid
         reccmd=u"/bin/cat \""+configreader.getConfDVB("DVBadapter")+adapt+u"/dvr0\" > \""+out+u"\""
         if decode==1:
@@ -97,7 +96,6 @@ def record(channel,tsid,out,timelength,decode=1):
         p2.wait()
         os.kill(p1.pid,signal.SIGKILL)
         p1.wait()
-        f.close()
     else:
         recdblist.printutf8ex(u"tuner busy",100,100)
 def useDVB():