OSDN Git Service

implement encode tester.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 24 Jun 2010 06:16:53 +0000 (06:16 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 24 Jun 2010 06:16:53 +0000 (06:16 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@635 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/auto_test.py [new file with mode: 0644]
rec10/trunk/src/chdb.py

diff --git a/rec10/trunk/src/auto_test.py b/rec10/trunk/src/auto_test.py
new file mode 100644 (file)
index 0000000..78ddcca
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# coding: UTF-8
+# Rec10 TS Recording Tools
+# Copyright (C) 2009-2010 Yukikaze
+import os
+import os.path
+import time
+
+import configreader
+import chdb
+import tv2mp4
+import tv2ts
+def test_all_ch_encode(option,time):
+    chl=chdb.getall()
+    print chl
+    path= configreader.getpath("test")
+    tpath=os.path.join(path, "encode_test")
+    if not os.path.exists(tpath):
+        os.mkdir(tpath)
+    dnowt=datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S")+"("+option+")"
+    tpatht=os.path.join(tpath,dnowt)
+    if not os.path.exists(tpatht):
+        os.mkdir(tpatht)
+    if len(chl)>0:
+        for t in chl:
+            print t
+            pathname=os.path.join(tpatht,t['chtxt'])
+            print pathname
+            tv2ts.tv2ts(pathname+".ts",t['ch'],t['csch'], time)
+            tv2mp4.ts2mp4(pathname+".ts", pathname+".mp4", option)
+            time.sleep(2)
+if __name__ == "__main__":
+    usage="usage: "
+    version="%prog 0.9.7"
+    parser=optparse.OptionParser(usage=usage,version=version)
+    parser.add_option("-e","--Encode",action="store",type="string",dest="encode_option",default="",metavar="TITLE",help="encode test(option)")
+    (opts,args)=parser.parse_args(sys.argv)
+    if opts.encode_option != "":##-sの場合
+        test_all_ch_encode(opts.encode_option, 10)
\ No newline at end of file
index 0d071c9..b0cc67b 100644 (file)
@@ -44,7 +44,7 @@ def getall():
         ret.append(rett)
     if len(ret) == 0:
         ret.append(None)
-    return ret[0]
+    return ret
 def update():
     ret = []
     CSupdate = 0