Author: duncan
Date: Sun Nov  4 06:37:04 2007
New Revision: 10070

Log:
The __init__ function requires an allowNone argument to be passed to its base 
class


Modified:
   branches/rel-1-7/freevo/src/helpers/commdetectserver.py
   branches/rel-1-7/freevo/src/helpers/encodingserver.py
   branches/rel-1-7/freevo/src/helpers/recordserver.py

Modified: branches/rel-1-7/freevo/src/helpers/commdetectserver.py
==============================================================================
--- branches/rel-1-7/freevo/src/helpers/commdetectserver.py     (original)
+++ branches/rel-1-7/freevo/src/helpers/commdetectserver.py     Sun Nov  4 
06:37:04 2007
@@ -43,8 +43,7 @@
     except Exception, e:
         print e
 
-from twisted.web import xmlrpc, server, sux
-from twisted.internet import reactor
+from twisted.web import xmlrpc, server
 from util.marmalade import jellyToXML, unjellyFromXML
 import time, random, sys, os
 import logging
@@ -60,7 +59,13 @@
 unjam = unjellyFromXML
 
 class CommDetectServer(xmlrpc.XMLRPC):
-    def __init__(self, debug=False):
+    """ Commercial detect server class """
+
+    def __init__(self, debug=False, allowNone=False):
+        """ Initialise the Commercial Detection Server class """
+        _debug_('CommDetectServer.__init__(debug=%r, allowNone=%r)' % (debug, 
allowNone), 1)
+        xmlrpc.XMLRPC.__init__(self, allowNone)
+        self.debug = debug
         self.jobs = {}
         self.queue = CommDetectQueue()
         _debug_("CommDetectServer started...", DINFO)
@@ -100,19 +105,21 @@
         return (True, jam(jlist))
 
 def main():
+    from twisted.internet import reactor
     global DEBUG
     if not (os.path.exists(tmppath) and os.path.isdir(tmppath)):
         os.mkdir(tmppath)
     os.chdir(tmppath)
-    app = Application("CommDetectServer")
+
+    debug = False
     if len(sys.argv) >= 2 and sys.argv[1] == "debug":
-        es = CommDetectServer(True)
+        debug = True
         import commdetectcore
-        commdetectcore.DEBUG=True
-    else:
-        es = CommDetectServer()
+        commdetectcore.DEBUG=debug
+
     _debug_('DEBUG=%s' % DEBUG, DINFO)
-    reactor.listenTCP(config.COMMDETECTSERVER_PORT, server.Site(es))
+    cds = CommDetectServer(debug=debug, allowNone=True)
+    reactor.listenTCP(config.COMMDETECTSERVER_PORT, server.Site(cds))
     reactor.run()
 
 if __name__ == '__main__':

Modified: branches/rel-1-7/freevo/src/helpers/encodingserver.py
==============================================================================
--- branches/rel-1-7/freevo/src/helpers/encodingserver.py       (original)
+++ branches/rel-1-7/freevo/src/helpers/encodingserver.py       Sun Nov  4 
06:37:04 2007
@@ -69,9 +69,11 @@
 
 class EncodingServer(xmlrpc.XMLRPC):
 
-    def __init__(self, debug=False):
+    def __init__(self, debug=False, allowNone=False):
         """ Initialise the EncodingServer class """
-        _debug_('__init__(debug=%r)' % (debug), 1)
+        _debug_('EncodingServer.__init__(debug=%r, allowNone=%r)' % (debug, 
allowNone), 1)
+        xmlrpc.XMLRPC.__init__(self, allowNone)
+        self.debug = debug
         self.jobs = {}
         self.queue = EncodingQueue()
         _debug_("EncodingServer started...", DINFO)
@@ -215,13 +217,13 @@
     tmppath = tempfile.mkdtemp(prefix = 'encodeserver')
     os.chdir(tmppath)
 
+    debug = False
     if len(sys.argv) >= 2 and sys.argv[1] == "debug":
-        es = EncodingServer(True)
+        debug = True
         import encodingcore
-        encodingcore.DEBUG=True
-    else:
-        es = EncodingServer()
+        encodingcore.DEBUG = debug
     _debug_('main: DEBUG=%s' % DEBUG, DINFO)
+    es = EncodingServer(debug=debug, allowNone=True)
     reactor.listenTCP(config.ENCODINGSERVER_PORT, server.Site(es))
     reactor.run()
 

Modified: branches/rel-1-7/freevo/src/helpers/recordserver.py
==============================================================================
--- branches/rel-1-7/freevo/src/helpers/recordserver.py (original)
+++ branches/rel-1-7/freevo/src/helpers/recordserver.py Sun Nov  4 06:37:04 2007
@@ -117,7 +117,11 @@
 
 class RecordServer(xmlrpc.XMLRPC):
 
-    def __init__(self):
+    def __init__(self, debug=False, allowNone=False):
+        """ Initialise the Record Server class """
+        _debug_('RecordServer.__init__(debug=%r, allowNone=%r)' % (debug, 
allowNone), 1)
+        xmlrpc.XMLRPC.__init__(self, allowNone)
+        self.debug = debug
         self.lock = threading.Lock()
         self.fc = FreevoChannels()
         # XXX: In the future we should have one lock per VideoGroup.
@@ -1675,7 +1679,7 @@
 
 
 def main():
-    rs = RecordServer()
+    rs = RecordServer(allowNone=True)
     reactor.listenTCP(config.RECORDSERVER_PORT, server.Site(rs))
     rs.startMinuteCheck()
     rc_object.subscribe(rs.eventNotice)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to