Skip to content
Permalink
Browse files

TODO→TO-DONE

  • Loading branch information...
glyph committed Jun 26, 2013
1 parent 9d7b403 commit 4b0bb51cc13b66312df36d362f53e808c70a6995
Showing with 13 additions and 15 deletions.
  1. +13 −15 calendarserver/tools/agent.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python

# -*- test-case-name: calendarserver.tools.test.test_agent -*-
##
# Copyright (c) 2013 Apple Inc. All rights reserved.
#
@@ -45,17 +45,7 @@
from twisted.web.server import Site, NOT_DONE_YET
from zope.interface import implements


# TODO, implement this:
# from launchd import getLaunchdSocketFds

def getLaunchdSocketFds():
pass

# For the sample client, below:
from twisted.internet import reactor
from twisted.internet.protocol import ClientCreator

from twext.python.launchd import getLaunchDSocketFDs
from twext.python.log import Logger
log = Logger()

@@ -234,7 +224,7 @@ def makeAgentService(store):
"""
from twisted.internet import reactor

sockets = getLaunchdSocketFds()
sockets = getLaunchDSocketFDs()
fd = sockets["AgentSocket"][0]

family = socket.AF_INET
@@ -355,8 +345,16 @@ def buildProtocol(self, addr):
</plist>"""

def getList():
# For the sample client, below:
from twisted.internet import reactor
from twisted.internet.protocol import ClientCreator

creator = ClientCreator(reactor, amp.AMP)
d = creator.connectTCP('sagen.apple.com', 62308)
host = '127.0.0.1'
import sys
if len(sys.argv) > 1:
host = sys.argv[1]
d = creator.connectTCP(host, 62308)

def connected(ampProto):
return ampProto.callRemote(GatewayAMPCommand, command=command)
@@ -370,7 +368,7 @@ def done(result):
print('Done: %s' % (result,))
reactor.stop()
d.addCallback(done)
reactor.run()

if __name__ == '__main__':
getList()
reactor.run()

0 comments on commit 4b0bb51

Please sign in to comment.
You can’t perform that action at this time.