Changeset 24673
- Timestamp:
- 09/02/2008 11:51:38 AM (10 months ago)
- Files:
-
-
branches/run-plugin-1490-2/doc/core/howto/tap.xhtml (modified) (2 diffs)
-
branches/run-plugin-1490-2/twisted/conch/tap.py (modified) (2 diffs)
-
branches/run-plugin-1490-2/twisted/mail/tap.py (modified) (2 diffs)
-
branches/run-plugin-1490-2/twisted/names/tap.py (modified) (2 diffs)
-
branches/run-plugin-1490-2/twisted/plugins/twisted_run.py (modified) (1 diff)
-
branches/run-plugin-1490-2/twisted/test/test_twistd.py (modified) (4 diffs)
-
branches/run-plugin-1490-2/twisted/web/tap.py (modified) (2 diffs)
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
-
branches/run-plugin-1490-2/doc/core/howto/tap.xhtml
r23767 r24673 137 137 class="API" base="twisted.application.service">IService</code> 138 138 implementation which will be run by <code class="shell">twistd</code>, 139 in this case an <code class="API" base="twisted.application"> 140 internet.TCPServer</code>. You can read more about services in the <a 141 href="application.xhtml">application howto</a>: for example, it describes 142 <a href="application.xhtml#services-provided">the list of services 139 in this case an 140 <code class="API" base="twisted.application">internet.TCPServer</code>. You 141 can read more about services in the <a href="application.xhtml">application 142 howto</a>: for example, it describes <a 143 href="application.xhtml#services-provided">the list of services 143 144 provided</a> and how to build <a 144 145 href="application.xhtml#service-collection">service collections</a>. … … 148 149 <code class="python">MyServiceMaker</code> because <code class="shell"> 149 150 twistd run</code> accepts the name of an object that <strong>provides 150 </strong> <code class="API" base="twisted.application.service">151 ISimpleServiceMaker</code>, not the name of an object that <strong>152 implements</strong> it.151 </strong> 152 <code class="API" base="twisted.application.service">ISimpleServiceMaker</code>, 153 not the name of an object that <strong> implements</strong> it. 153 154 </p> 154 155 155 156 <p> 156 157 To run this service, you call the run plugin with twistd, passing the fully 157 qualified named of your object providing <code class="API" base="twisted.application.service">158 ISimpleServiceMaker</code>.158 qualified named of your object providing 159 <code class="API" base="twisted.application.service">ISimpleServiceMaker</code>. 159 160 </p> 160 161 -
branches/run-plugin-1490-2/twisted/conch/tap.py
r24610 r24673 6 6 """ 7 7 8 from zope.interface import moduleProvides9 10 8 from twisted.conch import checkers, unix 11 9 from twisted.conch.openssh_compat import factory … … 13 11 from twisted.python import usage 14 12 from twisted.application import strports 15 from twisted.application.service import ISimpleServiceMaker16 17 18 19 moduleProvides(ISimpleServiceMaker)20 13 21 14 -
branches/run-plugin-1490-2/twisted/mail/tap.py
r24610 r24673 8 8 9 9 import os 10 11 from zope.interface import moduleProvides12 10 13 11 from twisted.mail import mail … … 21 19 from twisted.cred import checkers 22 20 from twisted.application import internet 23 from twisted.application.service import ISimpleServiceMaker24 25 26 27 moduleProvides(ISimpleServiceMaker)28 21 29 22 -
branches/run-plugin-1490-2/twisted/names/tap.py
r24610 r24673 8 8 import os, traceback 9 9 10 from zope.interface import moduleProvides11 12 10 from twisted.python import usage 13 11 from twisted.names import dns … … 18 16 from twisted.names import secondary 19 17 20 21 moduleProvides(service.ISimpleServiceMaker)22 18 23 19 -
branches/run-plugin-1490-2/twisted/plugins/twisted_run.py
r24610 r24673 78 78 raise SystemExit("'%s' doesn't provide the ISimpleServiceMaker " 79 79 "interface" % (options['maker'],)) 80 opts = getattr(maker, 'options', None) 81 if opts is not None: 82 subOptions = opts() 83 else: 84 # Compatibility with tap module 85 subOptions = maker.Options() 80 subOptions = maker.options() 86 81 subOptions.parseOptions(options['maker_options']) 87 82 return maker.makeService(subOptions) -
branches/run-plugin-1490-2/twisted/test/test_twistd.py
r24610 r24673 1078 1078 1079 1079 1080 class StubTAP(object):1081 """1082 A fake TAP module to be run by L{RunPlugin}.1083 """1084 implements(service.ISimpleServiceMaker)1085 Options = StubOptions1086 1087 def makeService(self, options):1088 """1089 Create a dummy service and save options in C{self.savedOptions}.1090 """1091 self.savedOptions = options1092 self.service = service.Service()1093 return self.service1094 1095 1096 1097 1080 class RunPluginTests(unittest.TestCase): 1098 1081 """ 1099 1082 Tests for the twistd L{RunPlugin}. 1100 1101 @cvar stubTAP: a TAP module to use during tests.1102 @type stubTAP: L{StubTAP}1103 1083 1104 1084 @cvar stubService: a service to use during tests. … … 1115 1095 self.plugin = RunPlugin() 1116 1096 cls = self.__class__ 1117 cls.stubTAP = StubTAP()1118 1097 cls.stubService = StubServiceMaker() 1119 1098 directlyProvides(cls.stubService, service.ISimpleServiceMaker) … … 1127 1106 """ 1128 1107 cls = self.__class__ 1129 cls.stubTAP = None1130 1108 cls.stubService = None 1131 1109 … … 1221 1199 1222 1200 1223 def test_tapModule(self):1224 """1225 L{RunPlugin.makeService} supports running TAP modules, the difference1226 being that the options attribute has a different name.1227 """1228 opt = self.plugin.options()1229 opt.parseArgs("%s.%s.stubTAP" % (1230 self.__module__, self.__class__.__name__))1231 srv = self.plugin.makeService(opt)1232 self.assertIdentical(srv, self.stubTAP.service)1233 self.assertEquals(self.stubTAP.savedOptions, {'foo': '1234'})1234 1235 1236 1201 def test_foundInPlugins(self): 1237 1202 """ -
branches/run-plugin-1490-2/twisted/web/tap.py
r24610 r24673 7 7 8 8 import os 9 10 from zope.interface import moduleProvides11 9 12 10 from twisted.web import server, static, twcgi, script, demo, distrib, trp … … 15 13 from twisted.spread import pb 16 14 from twisted.application import internet, service, strports 17 18 19 20 moduleProvides(service.ISimpleServiceMaker)21 15 22 16
