#!/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
"""
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:
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']
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()