[CalendarServer-changes] [12033] CalendarServer/trunk/twext/application/masterchild.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:18:10 PDT 2014


Revision: 12033
          http://trac.calendarserver.org//changeset/12033
Author:   wsanchez at apple.com
Date:     2013-12-04 17:25:30 -0800 (Wed, 04 Dec 2013)
Log Message:
-----------
Use classes instead of namedtuple

Modified Paths:
--------------
    CalendarServer/trunk/twext/application/masterchild.py

Modified: CalendarServer/trunk/twext/application/masterchild.py
===================================================================
--- CalendarServer/trunk/twext/application/masterchild.py	2013-12-05 00:30:14 UTC (rev 12032)
+++ CalendarServer/trunk/twext/application/masterchild.py	2013-12-05 01:25:30 UTC (rev 12033)
@@ -29,7 +29,6 @@
 
 
 import sys
-from collections import namedtuple
 
 from zope.interface import implementer
 
@@ -138,7 +137,10 @@
 
 
 
-Child = namedtuple("Child", ("transport", "protocol"))
+class ChildProcess(object):
+    def __init__(self, transport, protocol):
+        self.transport = transport
+        self.protocol = protocol
 
 
 
@@ -207,7 +209,7 @@
             childFDs={0: b"w", 1: b"r", 2: b"r", 3: inheritedFD}
         )
 
-        child = Child(transport, processProtocol)
+        child = ChildProcess(transport, processProtocol)
 
         self.log.info(
             u"Spawned child process ({child.transport.pid}) "
@@ -433,4 +435,7 @@
 
 
 
-Status = namedtuple("Status", ("sentCount", "ackedCount"))
+class Status(object):
+    def __init__(self, sentCount, ackedCount):
+        self.sentCount = sentCount
+        self.ackedCount = ackedCount
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/25257e01/attachment.html>


More information about the calendarserver-changes mailing list