|
|
|
11/28/2005
I have released CPSMailAccess 1.2.0 today. It includes bugfixes, engine and
UI enhancements.
The next steps will become very interesting because it will provide some features we wanted to have since we started the project:
Also, a major upcoming change will be on ajax side, as I'll refactor the javascript code to make it rely on a third party js library. This will also be helpfull to start unit testing this part of the app. Last, I'll probably add a import feature from other mail clients, in order to grab configured filters. I've been told this was the last thing that was missing to adopt CPSMailAccess over that exotic and unfamous mail client called Thunderbird ;) here's the annoucement: http://www.cps-project.org/sections/news/cpsmailaccess-1-2-0
Posted by Tarek Ziadé @ 11/28/2005 01:54 PM.
-
Categories:
cps,
python,
semantic_web,
zope
-
1287 comments
11/05/2005
Please read this blog entry from here
What 's XML-RPC ?XML-RPC is a very simple Remote Procedure Control encoded in xml that can be used to interact with an application server from another program (another server, a rich client, or some Ajax'ed web Page) More infos at wikipedia XML-RPC in Zope 3Zope 3 comes with a very handy approach to provide XML-RPC features. You just have to write a view class that provides methods that will be available as RPC methods. If you are coming for Zope 2 world, please read up philliKon's slides at worldcookery (other Z3 goodies can be found there). My First XMLRPC PackageLet's write a small Zope 3 package to provide an XML-RPC method over all server folders, that provides a folder listing. This product is a folder composed of two files:
FolderListing View class in xmlrpctest.pyWriting a XML-RPC view is extremely simple
from zope.app.publisher.xmlrpc import XMLRPCView
class FolderListing(XMLRPCView):
def contents(self):
""" returns the folder content """
return list(self.context.keys())
The contents() method just returns the context elements. IntrospectionZope 3 will also automatically provide three extra methods for XML-RPC Introspection, that helps on API discovering from the client:
Get more info about introspection here: introspection. Since Python does not provide static typing, methodSignature needs a bit of help to return the signature of the method. A method decorator called xmlrpccallable is provided and can be used on the View:
from zope.app.publisher.xmlrpc import XMLRPCView
from zope.app.xmlrpcintrospection.xmlrpcintrospection import xmlrpccallable
class FolderListing(XMLRPCView):
@xmlrpccallable(str)
def contents(self):
""" returns the folder content """
return list(self.context.keys())
The first decorator parameter is the return type, and the next parameters are the arguments type, if needeed. Linking the view in configure.zcmlIn the configuration file, we will tell Zope 3 that FolderListing() has to be instanciated and used everytime a XML-RPC call is made on a zope folder: The xmlrpc:view directive, provided by zope.app.publisher.xmlrpc hooks everything up. Setting up the packageThe three files are saved into a folder called xlmrpctest into {$INSTANCE}/lib/python. Last but not least, a zcml file, called xmlrpctest-configure.zcml,has to be added in {$INSTANCE}/etc/package-includes/ to let zope 3 know about the package. xmlrpctest-configure.zcml: <include package="xmlrpctest" />That's all, Zope can be restarted ! Trying out the XML-RPC methodLet's try out our product, with a few lines of python, using xmlrpclib:
from XMLRPCAuth import BasicAuthTransport
from xmlrpclib import ServerProxy
transport = BasicAuthTransport('admin', 'admin')
proxy = ServerProxy('http://localhost:8080/ok', transport=transport)
print 'method list:'
for method in proxy.listMethods():
signature = proxy.methodSignature(method)[0]
returned_type = signature[0]
arguments_type = ', '.join(signature[1:])
print ' + %s(%s) -> %s: %s' % (method, arguments_type, returned_type,
proxy.methodHelp(method).strip())
This small program will display all XML-RPC methods available on the folder ok, with their signatures. The XMLRPCAuth package is a simple module that provides a basic authorization transport, and can be taken here: XMLRPCAuth tziade@Tarek:/home/tziade$ python z3test.py method list: + contents() -> str: returns the content of the folder
11/01/2005
I am trying to choose a new IDE to write Python code, after a few problems I
had with the *beeeep* generic editor I use.
I've read the very interesting blurg from Jonathan Ellis here but i didn't find the IDE that fits me yet. I am trying them all. WishlistThe perfect IDE for me needs:
Tried so far: drpython, SPE, Eric3, WingIde, Bluefish, BoaConstructor, Kate
I won't try PyDev, i need to run other softwares when I am working ;) Conclusion
DrPython is one of the smartest, nicest of the list in my opinion, Eric3 and
WingIde are rocking too. But at this time, I go for SPE, because it is a
very fast moving project, and will probably fullfill all my wishes
soon. |
Nuxeo Bloggers: Log in! Search Nuxeo Blogs
About this blog
Tarek Ziadé Nuxeo Bloggers
Photos and Pictures
|
|
Nuxeo -
Indesko -
Nuxeo 5 Project
All content is copyrighted by their author. CPSSkins is Copyright © 2003-2006 by Jean-Marc Orliaguet. | CPS is Copyright © 2002-2006 by Nuxeo SAS. |