Mayavimmer | 7 Jul 19:31 2014
Picon

Persistent Pyro

I am trying to persist a Pyro4 object. I modified the Warehouse example 
to try to store to a Shelve store. My strategy is to duplicate the 
Warehouse instance when it comes time to save it, creating a non 
Pyroized copy which can the be saved. Here are the steps:

1. Created a Warehouse.dup() with:
     n = Warehouse()
     n.contents[:] = self.contents
     return n

2. def save: # calls dup() and stores its non-Pyroized true Warehouse 
instance into the Shelve object.

3. def store: # if name == 'quit', save etc.

Problem: I now get: ConnectionClosedError: receiving: not enough data
The server undoubtedly attempted to close the connection while the 
client held a live instance of Warehouse.

How do I shut down cleanly?

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Irmen de Jong | 7 Jul 02:09 2014
Picon

metadata and decorators are coming your way

Hi,

I've just checked in the first batch of changes for Pyro 4.27 where a new feature is
coming: object metadata querying.

This means that the the client (proxy) can ask the server about the methods and
attributes of the remote object. This query is done when the proxy is bound (connected).
For now, only the oneway methods are actually doing something: you don't have to
manually set _pyroOneway all the time on your proxy anymore!

I also want to add some extra features based on this. For instance the method names
could be used for client-side error checking on invalid method calls, and perhaps the
attribute names can be used to implement truly transparent remote attribute access again
(like we had in Pyro 3.x) - but no promises there.

For the oneway method metadata there's a new decorator  <at> Pyro4.oneway that you can use on
the methods in your remote object, to mark them. I expect to add some more decorators,
see issue #44 on github.

If you have the time please check it out in the trunk version and let me know if you
have questions or ideas about all this!

Cheers

Irmen

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
(Continue reading)

Plamen Dimitrov | 5 Jul 15:45 2014

Re: Pyro-core Digest, Vol 87, Issue 1

Subject:
Re: [Pyro] Serializing attributes and indexing
From:
Irmen de Jong <irmen-eetuc4ylCQMqcZcGjlUOXw@public.gmane.org>
Date:
07/04/2014 11:44 PM
To:
pyro-core-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

On 4-7-2014 21:06, Plamen Dimitrov wrote:
> Hi Irmen, > > Thank you for your last reply - it was all I needed to know about customer serialization > and the good practice of relying on the automatic serialization of the proxy objects > themselves. > > I wanted to ask you about another thing - serializing object attributes and possibly > indexing. I have problems serializing cases like > > 1) params = Pyro4.Proxy("some-uri-here") > params["some_present_key"] > > resulting in an error of the kind "TypeError: 'Proxy' object is unsubscriptable".
Yeah, only method calls are proxied. Attribute access and indexing aren't.
> It might be an edge case so I was also wondering about a far simple case when I need to > access a simple attribute/field of a remote object: > > 2) firefox = Pyro4.Proxy("PYRONAME:firefox") > print firefox.download_location > > where the download location is a simple string of the kind > > firefox.download_location = "C:\\" > > I was thinking about relying on a get() method in the first case > (params.get("some_present_key")) and properties in the second. Do you think there is a > more natural solution to this that requires less modification of an already existing code?
Indeed, the get() method is what I'm suggesting as well. You could perhaps subclass Pyro4.Proxy with a custom proxy class that implements __index__ and make it call your get() method, but I think that's more hassle that it's worth.

This is indeed quite much but I prefer to minimize modification of the original code. In order for the method above to work I need the get() method to exist on the remote object. This is indeed the case here, but I was also wondering if I could use similar approach to access remote attributes. Is there any way to surpass the Proxy object methods by let's say call something of the kind

firefox._original_object.method_that_could_also_be_found_in_the_proxy_class

?

I definitely need access to more than just the remote object's methods like its magic methods and attributes even if it is indirectly like above. Implementing methods especially for attributes would be a large modification of the original code on my side. Do you think this is possible? What else could I do?

Kind regards,
Plamen

Attachment (smime.p7s): application/pkcs7-signature, 5385 bytes
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Plamen Dimitrov | 4 Jul 21:06 2014

Serializing attributes and indexing

Hi Irmen,

Thank you for your last reply - it was all I needed to know about 
customer serialization and the good practice of relying on the automatic 
serialization of the proxy objects themselves.

I wanted to ask you about another thing - serializing object attributes 
and possibly indexing. I have problems serializing cases like

1) params = Pyro4.Proxy("some-uri-here")
      params["some_present_key"]

resulting in an error of the kind "TypeError: 'Proxy' object is 
unsubscriptable".

It might be an edge case so I was also wondering about a far simple case 
when I need to access a simple attribute/field of a remote object:

2) firefox = Pyro4.Proxy("PYRONAME:firefox")
      print firefox.download_location

where the download location is a simple string of the kind

firefox.download_location = "C:\\"

I was thinking about relying on a get() method in the first case 
(params.get("some_present_key")) and properties in the second. Do you 
think there is a more natural solution to this that requires less 
modification of an already existing code?

Best,
Plamen

Attachment (smime.p7s): application/pkcs7-signature, 5385 bytes
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Mayavimmer | 30 Jun 21:25 2014
Picon

Pyro4 Shelve Unicode error

Hi Pyro-core list,

I get an unicode error while reading a shelve object on my recent Rosa 
Linux. The shelve object was working correctly before being Pyroized. I 
read somewhere that old Shelve versions had unicode problems, but that 
was 4-5 years ago. Here is the the last part of the stack trace:

...
   File 
"/usr/lib/python2.7/site-packages/Pyro4-4.25-py2.7.egg/Pyro4/core.py", 
line 163, in __call__
     return self.__send(self.__name, args, kwargs)
   File 
"/usr/lib/python2.7/site-packages/Pyro4-4.25-py2.7.egg/Pyro4/core.py", 
line 327, in _pyroInvoke
     raise data
TypeError: String or Integer object expected for key, unicode found

Mayavimmer

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Irmen de Jong | 26 Jun 23:19 2014
Picon

Pyro 4.26 released!


Hi,

Pyro 4.26 has just been released!

Get it from Pypi:  http://pypi.python.org/pypi/Pyro4/
Or straight from Github:  https://github.com/irmen/Pyro4
Documentation: http://pythonhosted.org/Pyro4/index.html

Overview of new stuff in this version:

introduced PICKLE_PROTOCOL_VERSION config item
fixed exception handling when dealing with different major Python versions. Using
serpent or json now also properly translates exception objects even if the major
Python version differ
because of the new way Pyro deals with serialized exceptions, the wire protocol
version was updated to 47. You?ll have to update all Pyro4 libraries to 4.26
name server prints a warning if a protocol error occurs (this helps to spot issues
such as serializer protocol mismatches)
more info in documentation about pickle and numpy
improved documentation index

Have fun!

Irmen de Jong
Irmen de Jong | 26 Jun 23:18 2014
Picon

Pyrolite 3.1 released (pyro 4.26 compatibility)


Hi,

I've released a new version (3.1) of Pyrolite, the native-Java and .Net library to
interface with Pyro and Python/pickle.

It got the wire protocol version bumped to that of the latest Pyro release (4.26).

Pyrolite can only speak Pyro wire protocol v47, which is used by Pyro 4.26 and
newer. This Pyrolite release can not be used with older Pyro versions.
Note that the Serpent serializer is used by default, and you will need to include
Serpent version 1.5 or newer in your project for that. You can configure Pyrolite to
use pickle instead though, in which case you don't have to include the Serpent library
in your project.

Get it at: https://github.com/irmen/Pyrolite
Binaries at: http://irmen.home.xs4all.nl/pyrolite/

Have fun,

Irmen de Jong
Plamen Dimitrov | 14 Jun 20:57 2014

Cannot return object copies (autoproxy off)

Hi Irmen,

First off let me say how amazing your Pyro4 is! Achieving such little 
modification of the existing code makes it possible to distribute many 
complex cases, the documentation is great and really informative, and 
the functionality is of course over the top of my expectations. Now 
about the problem I encountered which might be pretty straightforward 
but at least it didn't seem so from the documentation:

I followed the most basic example to register an object and according to 
the documentation if I turn off the autoproxy option (of course it would 
be better on, but I cannot modify the original code I am trying to 
distribute over the network), I should receive a copy of the remotely 
constructed object. However, all I get is

ProtocolError: unsupported serialized class: ...

which is not really true because I have already remotely accessed 
different instances of the same class (!). In a more illustrative example:

I want to share an instance of Dog where remotely calling its method 
bark(), I get back an instance of Sound. I have registered the Dog 
instance and when I call bark(), I get the above error. In a different 
case I have remotely called a method of Sound and had no troubles 
serializing the Sound instance and accessing it remotely. Do you have 
any ideas what am I doing wrong? In the case of AUTOPROXY=True I would 
expect the remotely generated Sound instance and without it I was hoping 
for at least a copy. However, I got the above error (I get the same 
error on far simpler classes with no methods at all like Exception 
subclasses).

Thank you and I can provide any additional information if needed,
Plamen Dimitrov

Attachment (smime.p7s): application/pkcs7-signature, 5385 bytes
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
hjxwho | 29 May 17:21 2014
Picon

Prevent a method from being called

Hello,
Is it possible there is a way to prevent an existing method from being called because this method is only avaliable to the server?
Thank you,
Klaus
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
hjxwho | 15 May 17:23 2014
Picon

NAT configuration

Hi all,
Does someone have tried to use Pyro4 under NAT? I use vituralbox to set up a server, and the Network setting is NAT. Also, i specific the port forwarding.
Then, in the code, I did this

daemon = Pyro4.Daemon(port=8888,nathost="140.182.27.137", natport=8889)

After this, 
I tried to call this remote on my host computer by using the uri provided by the server.
However, I received 

Pyro4.errors.ConnectionClosedError: receiving: not enough data 

It seems like the server did not receive any data from the client. I checked the port 8889, and it says it’s listening.
Is there any other configuration I need to do ?

Thank you,
Klaus
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
hjxwho | 16 Apr 09:48 2014
Picon

[Error 111] connection refused

Hi all,
When I tried to test Pyro4 on two separated vitural machines, I got this error:

cannot connect: [Error 111] Connection Refused

My two machines are using the NAT Network. They can ping each other and I also tried a little socket demo to ensure they can talk to each other. Also, I closed both firewalls. 

Can someone give me some advice? I really appreciate that!

Dante
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core

Gmane