OSDN Git Service

implement ffmepg interlaced option.
[rec10/rec10-git.git] / rec10 / trunk / src / gridserver.py
index 91037a4..cb449af 100755 (executable)
@@ -1,10 +1,11 @@
 #!/usr/bin/python
 # coding: UTF-8
 # Rec10 TS Recording Tools
-# Copyright (C) 2009 Yukikaze
+# Copyright (C) 2009-2010 Yukikaze
 from SocketServer import *
 
 import configreader
+import re
 import recdb
 import recdblist
 RECV_BUF = 8192
@@ -15,10 +16,10 @@ class Handler(BaseRequestHandler):
 
     """
     def handle(self):
-        recdblist.printutf8("connect from:", self.client_address)
+        print("connect from:", self.client_address)
         cons = getTask()
         recdblist.printutf8(cons + " is sent")
-        self.request.send(cons)
+        self.request.send(cons.encode('UTF-8'))
         """while True:
             #ret = self.request.recv(RECV_BUF)
             #if len(ret) == 0:
@@ -32,7 +33,7 @@ def getTask():
     tasks = recdb.getnow("1")
     rett = ""
     for task in tasks:
-        if task["type"] == recdblist.REC_ENCODE_QUE:
+        if task["type"] == recdblist.REC_ENCODE_QUE and not re.search("d",task['opt']) and not re.search("5",task['opt']):
             title = task['title']
             opt = task['opt']
             btime = task['btime']
@@ -48,7 +49,8 @@ def main():
     sv = ThreadingTCPServer(('', port), Handler)
     recdblist.printutf8("This is a Rec10 GridServer.")
     recdblist.printutf8("Waiting for connections at port" + str(port))
-    recdblist.printutf8('listen to:', sv.socket.getsockname())
+    recdblist.printutf8('listen to:')
+    print (sv.socket.getsockname())
     sv.serve_forever()
 
 if __name__ == '__main__': main()