[Checkins] SVN: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ remove xmlrpc code, it is depending on zope.app
Godefroid Chapelle
gotcha at bubblenet.be
Mon Mar 8 05:55:05 EST 2010
Log message for revision 109819:
remove xmlrpc code, it is depending on zope.app
Changed:
U Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/configure.zcml
U Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftesting.zcml
U Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftests.py
D Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.py
D Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.txt
D Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.zcml
-=-
Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/configure.zcml
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/configure.zcml 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/configure.zcml 2010-03-08 10:55:05 UTC (rev 109819)
@@ -33,6 +33,4 @@
factory=".task.EchoTask"
name="echo" />
- <include file="xmlrpc.zcml" />
-
</configure>
Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftesting.zcml
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftesting.zcml 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftesting.zcml 2010-03-08 10:55:05 UTC (rev 109819)
@@ -18,7 +18,6 @@
<include package="zope.app.authentication" />
<include package="zope.app.session" />
<include package="lovely.remotetask" />
- <include package="zope.app.xmlrpcintrospection" />
<utility
factory="lovely.remotetask.testing.ExceptionTask"
Modified: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftests.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftests.py 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/ftests.py 2010-03-08 10:55:05 UTC (rev 109819)
@@ -37,7 +37,6 @@
def test_suite():
suite1 = functional.FunctionalDocFileSuite(
'browser/README.txt',
- 'xmlrpc.txt',
setUp=setUp,
tearDown=tearDown,
)
Deleted: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.py 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.py 2010-03-08 10:55:05 UTC (rev 109819)
@@ -1,74 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Lovely Systems and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Task Service Implementation
-
-$Id$
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.app.xmlrpcintrospection.xmlrpcintrospection import xmlrpccallable
-from zope.app.publisher.xmlrpc import XMLRPCView
-
-class RemoteTaskServiceXMLRPCAPI(XMLRPCView):
- """An XML-RPC API for the external Remote Task Service API."""
-
- @xmlrpccallable(list)
- def getAvailableTasks(self):
- """Get all available tasks that the service provides.
-
- The result will be a list of task names.
- """
- return sorted(self.context.getAvailableTasks().keys())
-
- @xmlrpccallable(int, str, dict)
- def add(self, task, input):
- """Add a new job to the service.
-
- The result will be the id of the new job.
- """
- return self.context.add(unicode(task), input)
-
- @xmlrpccallable(bool, int)
- def cancel(self, jobid):
- """Cancel a job from execution.
-
- The result is meaningless.
- """
- self.context.cancel(jobid)
- return True
-
- @xmlrpccallable(str, int)
- def getStatus(self, jobid):
- """Get the status of the current job.
-
- The return value is a string representing the status.
- """
- return self.context.getStatus(jobid)
-
- @xmlrpccallable(dict, int)
- def getResult(self, jobid):
- """Get the result of the job execution.
-
- The return value will be a dictionary of return values. The content of
- the dictionary will vary with every task.
- """
- return self.context.getResult(jobid)
-
- @xmlrpccallable(str, int)
- def getError(self, jobid):
- """Get the error from a failed job execution.
-
- The return value will be an error message that describes the failure.
- """
- return self.context.getError(jobid)
Deleted: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.txt
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.txt 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.txt 2010-03-08 10:55:05 UTC (rev 109819)
@@ -1,420 +0,0 @@
-===============================
-Remote Task Service XML-RPC API
-===============================
-
-Before we can demonstrate the XML-RPC API of the task service, we need to add
-a task service first ...
-
- >>> from zope.testbrowser.testing import Browser
- >>> browser = Browser()
- >>> browser.addHeader('Authorization','Basic mgr:mgrpw')
- >>> browser.handleErrors = False
-
- >>> browser.open('http://localhost/manage')
- >>> browser.getLink(text='Remote Task Service').click()
- >>> browser.getControl(name='new_value').value = 'tasks'
- >>> browser.getControl('Apply').click()
-
-... and add a few tasks to the system:
-
- >>> import lovely.remotetask.task
- >>> import zope.component
-
- >>> def echo(input):
- ... return input
-
- >>> echoTask = lovely.remotetask.task.SimpleTask(echo)
- >>> zope.component.provideUtility(echoTask, name='echo')
-
- >>> def error(input):
- ... raise lovely.remotetask.task.TaskError('An error occurred.')
-
- >>> errorTask = lovely.remotetask.task.SimpleTask(error)
- >>> zope.component.provideUtility(errorTask, name='error')
-
-
-``getAvailableTasks()`` Method
-------------------------------
-
-Get the available tasks of the service:
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getAvailableTasks</methodName>
- ... <params>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- Content-Length: 255
- Content-Type: text/xml;charset=utf-8
- <BLANKLINE>
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><array><data>
- <value><string>echo</string></value>
- <value><string>error</string></value>
- <value><string>exception</string></value>
- </data></array></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-``add(task, input)`` Method
----------------------------
-
-Add a job to the service.
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>add</methodName>
- ... <params>
- ... <value><string>echo</string></value>
- ... <value><struct>
- ... <key><string>foo</string></key>
- ... <value><string>bar</string></value>
- ... </struct></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><int>1392637175</int></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-
-``cancel(jobid)`` Method
-------------------------
-
-Cancel a job.
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>cancel</methodName>
- ... <params>
- ... <value><int>1392637175</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><boolean>1</boolean></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-
-``getStatus(jobid)`` Method
----------------------------
-
-Get the status of a job.
-
- >>> result = http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>add</methodName>
- ... <params>
- ... <value><string>echo</string></value>
- ... <value><struct>
- ... <key><string>foo</string></key>
- ... <value><string>bar</string></value>
- ... </struct></value>
- ... </params>
- ... </methodCall>
- ... """)
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getStatus</methodName>
- ... <params>
- ... <value><int>1392637176</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><string>queued</string></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
- >>> getRootFolder()['tasks'].process()
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getStatus</methodName>
- ... <params>
- ... <value><int>1392637176</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><string>completed</string></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-
-``getResult(jobid)`` Method
----------------------------
-
-Once the job is completed we can get the result:
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getResult</methodName>
- ... <params>
- ... <value><int>1392637176</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><struct>
- <member>
- <name>foo</name>
- <value><string>bar</string></value>
- </member>
- </struct></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-
-``getError(jobid)`` Method
---------------------------
-
-When an error occured, you can get it. If no error occured, 'None' (string) is
-returned:
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getError</methodName>
- ... <params>
- ... <value><int>1392637176</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><string>None</string></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-Now let's check for real:
-
- >>> result = http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>add</methodName>
- ... <params>
- ... <value><string>error</string></value>
- ... <value><struct>
- ... </struct></value>
- ... </params>
- ... </methodCall>
- ... """)
-
- >>> getRootFolder()['tasks'].process()
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>getError</methodName>
- ... <params>
- ... <value><int>1392637177</int></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><string>An error occurred.</string></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-Introspection
--------------
-
-You can get a list of all methods:
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>listMethods</methodName>
- ... <params>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><array><data>
- <value><string>add</string></value>
- <value><string>cancel</string></value>
- <value><string>getAvailableTasks</string></value>
- <value><string>getError</string></value>
- <value><string>getResult</string></value>
- <value><string>getStatus</string></value>
- </data></array></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
-You can also inspect each method:
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>methodHelp</methodName>
- ... <params>
- ... <value><string>add</string></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><string>Add a new job to the service.
- <BLANKLINE>
- The result will be the id of the new job.
- </string></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
-
- >>> print http(r"""
- ... POST /tasks/ HTTP/1.0
- ... Authorization: Basic mgr:mgrpw
- ... Content-Type: text/xml
- ...
- ... <?xml version='1.0'?>
- ... <methodCall>
- ... <methodName>methodSignature</methodName>
- ... <params>
- ... <value><string>add</string></value>
- ... </params>
- ... </methodCall>
- ... """)
- HTTP/1.0 200 Ok
- ...
- <?xml version='1.0'?>
- <methodResponse>
- <params>
- <param>
- <value><array><data>
- <value><array><data>
- <value><string>int</string></value>
- <value><string>str</string></value>
- <value><string>dict</string></value>
- </data></array></value>
- </data></array></value>
- </param>
- </params>
- </methodResponse>
- <BLANKLINE>
Deleted: Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.zcml
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.zcml 2010-03-08 10:51:52 UTC (rev 109818)
+++ Sandbox/gotcha/z3c.taskqueue/src/z3c/taskqueue/xmlrpc.zcml 2010-03-08 10:55:05 UTC (rev 109819)
@@ -1,11 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/xmlrpc">
-
- <view
- for=".interfaces.ITaskService"
- methods="getAvailableTasks add cancel getStatus getResult getError"
- class=".xmlrpc.RemoteTaskServiceXMLRPCAPI"
- permission="zope.View"
- />
-
-</configure>
More information about the checkins
mailing list