[CalendarServer-changes] [10058] CalendarServer/branches/users/glyph/one-home-list-api
source_changes at macosforge.org
source_changes at macosforge.org
Fri Nov 16 14:48:56 PST 2012
Revision: 10058
http://trac.calendarserver.org//changeset/10058
Author: glyph at apple.com
Date: 2012-11-16 14:48:55 -0800 (Fri, 16 Nov 2012)
Log Message:
-----------
document many attributes
Modified Paths:
--------------
CalendarServer/branches/users/glyph/one-home-list-api/calendarserver/tools/shell/terminal.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/one-home-list-api/
Modified: CalendarServer/branches/users/glyph/one-home-list-api/calendarserver/tools/shell/terminal.py
===================================================================
--- CalendarServer/branches/users/glyph/one-home-list-api/calendarserver/tools/shell/terminal.py 2012-11-16 22:48:54 UTC (rev 10057)
+++ CalendarServer/branches/users/glyph/one-home-list-api/calendarserver/tools/shell/terminal.py 2012-11-16 22:48:55 UTC (rev 10058)
@@ -89,7 +89,28 @@
super(ShellOptions, self).__init__()
+
class ShellService(Service, object):
+ """
+ A L{ShellService} collects all the information that a shell needs to run;
+ when run, it invokes the shell on stdin/stdout.
+
+ @ivar store: the calendar / addressbook store.
+ @type store: L{txdav.idav.IDataStore}
+
+ @ivar directory: the directory service, to look up principals' names
+ @type directory: L{twistedcaldav.directory.idirectory.IDirectoryService}
+
+ @ivar options: the command-line options used to create this shell service
+ @type options: L{ShellOptions}
+
+ @ivar reactor: the reactor under which this service is running
+ @type reactor: L{IReactorTCP}, L{IReactorTime}, L{IReactorThreads} etc
+
+ @ivar config: the configuration associated with this shell service.
+ @type config: L{twistedcaldav.config.Config}
+ """
+
def __init__(self, store, directory, options, reactor, config):
super(ShellService, self).__init__()
self.store = store
@@ -100,6 +121,7 @@
self.terminalFD = None
self.protocol = None
+
def startService(self):
"""
Start the service.
@@ -114,6 +136,7 @@
self.protocol = ServerProtocol(lambda: ShellProtocol(self))
StandardIO(self.protocol)
+
def stopService(self):
"""
Stop the service.
@@ -123,9 +146,13 @@
os.write(self.terminalFD, "\r\x1bc\r")
+
class ShellProtocol(ReceiveLineProtocol):
"""
Data store shell protocol.
+
+ @ivar service: a service representing the running shell
+ @type service: L{ShellService}
"""
# FIXME:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121116/dfc9a576/attachment.html>
More information about the calendarserver-changes
mailing list