question: howto transfer objects between server and client?

2007-08-11 Thread OpenPavilion
Hello community,

maybe one of you can help me out with a question regarding the
transfer of objects betwen client an server:
I have three files:

### ClassA.py ###
class ClassA:
def setA(self, newA):
self.a = newA
def getA(self):
return self.a

### client.py ###
import xmlrpclib
from ClassA import *
a = ClassA()
a.setA(4711)
server = xmlrpclib.ServerProxy("http://localhost:";)
print server.getA(a)# <= here I would like to hand over an
object

### server.py ###
import SimpleXMLRPCServer
from ClassA import *
class Handler:
def getA(self, aClass):
return aClass.getA()   # <- XMLRPC only transports simple types 
and
dictionaries, but no objects
handler_object = Handler()
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", ))
server.register_instance(handler_object)
print "Listening on port "
server.serve_forever()


The problem is, that though I hand a ClassA object to the XMLRPC
server, the server only receives a dictionary (only transfering simple
objects is a XMLRPC feature: http://docs.python.org/lib/module-xmlrpclib.html)

Since XMLRPC has limited features:  Is there any other server/client
technique to transfer objects (not strings, or dictionaries, but self
defined object types) ?

Regards
Bernd

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: question: howto transfer objects between server and client?

2007-08-11 Thread OpenPavilion
On 11 Aug., 11:21, Irmen de Jong <[EMAIL PROTECTED]> wrote:
> OpenPavilion wrote:
> > Since XMLRPC has limited features:  Is there any other server/client
> > technique to transfer objects (not strings, or dictionaries, but self
> > defined object types) ?
>
> Take a look at Pyro;  http://pyro.sourceforge.net
>
> --Irmen

Thanks Irmen,

just found out, that if I use "pickle.dumps(object)" (on client side)
and "pickle.loads(object)" (on server side) before and after sending,
I have access to the object.

I love this python language !
Python is a really, really nice language and I often find that the
solution is easier as I thought in the first place ...

Thanks anyway !!
Regards
Bernd

-- 
http://mail.python.org/mailman/listinfo/python-list


Question: wxpython and 3d engine example with model load ?

2007-08-23 Thread OpenPavilion
Hello,

did anyone succeed in combining wxpython and a 3d engine (pyogre,
crystalblend, panda3d, soya etc.) ?

I would like to create an application, which uses wxpython tree, menu
and grid elements and embedds a 3d view of some of the listed objects
in an own detail window, so showing the object as a 3d model.
I know there is PyOpenGL as well, but I need to load complete models
(meshes done with cinema4d or blender) into the 3d view.

So it would be very nice, if someone could post me a link to an
example, where someone has successfully glued wxpython UI and a 3d
engine view loading meshes into the 3d view.

Regards
Bernd

-- 
http://mail.python.org/mailman/listinfo/python-list


wxstyledtextctrl and xml markup

2007-09-13 Thread OpenPavilion Team

Hello community,

I want to create an editor for a self defined xml markup language. I want to
use wxpython with wxstyledtextctrl and I have looked around at yellowbrain
site, but there are no examples. I also watched the styledtextctrl examples
with wxpython 2.8.4.

What I am looking for is an example of how to do the autocompletion part for
the styledtextctrl based on my self defined XML language.

example:

 
 
  
 
 [...]



Since I don't know styledtextctrl, I fear that I am about to write a complex
handler for the autocompletion part, whereas there could be some easy to use
features built into styledtextctrl. My problem is that I don't want to
externalize the grammar of the XML instead of coding it inside the
autocompletion handler.

Are there any examples for wxstyledtextctrl, xml and autocompletion ?

Regards
Pavilion
-- 
View this message in context: 
http://www.nabble.com/wxstyledtextctrl-and-xml-markup-tf4435096.html#a12652955
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list