madhuri | 10 Mar 05:43 2014
Picon

High Availability of Pyro Servers

Hi All,

I have installed pyro on my machine and able to interact with remote objects
on different machine.

But I have a question regarding availability of Pyro servers. 
For eg. If I have multiple pyro servers(one running as master server at a
time and others as slave servers), is there any way in pyro to invoke slave
servers to run as master in case of any failures?

Thanks, in advance!!

------------------------------------------------------------------------------
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/13534_NeoTech
Tom Hanson | 3 Mar 17:41 2014

Having trouble handling events

Hey everyone!

I'm trying to add Pyro4 events to my gobject MainLoop, but I'm having trouble with handling them.

This is some of some code that I've tried:

def start_pyro(self,device_id):
    """Sets up Pyro, sharing Slave, and starting the eventloop"""
    def handle_pyro(self, socket,*args):
      daemon.events(socket)
      return True
      
    slave = Slave()
    
    daemon=Pyro4.Daemon()
    ns=Pyro4.locateNS()
    uri=daemon.register(slave)
    ns.register("pisync.slave.%s" % device_id, uri)
    
    gobject.io_add_watch(daemon.sockets[0],gobject.IO_IN,handle_pyro)
    gobject.MainLoop().run()

It seems to run fine, but when I try to access the object remotely the remote device just hangs and the local device displays:

Traceback (most recent call last):
  File "modules/pyro_slave_new.py", line 83, in handle_pyro
    print daemon.events([socket])
  File "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 658, in events
    return self.transportServer.events(eventsockets)
  File "/usr/local/lib/python2.7/dist-packages/Pyro4/socketserver/threadpoolserver.py", line 133, in events
    assert self.sock in eventsockets
AssertionError

Could anyone point me to where I'm going wrong?

Thanks!
Tom Hanson
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Marcell Legeza | 24 Feb 22:11 2014
Picon

Stockmarket tutorial help

Hello!

I would like to ask for help regarding the stockmarket tutorial. I have a clean ubuntu installation in which i copy-pasted the code of the tutorial. I start the nameserver and the stockmarket cannot connect to it. The full error is here:

Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/naming.py", line 334, in locateNS
    proxy.ping()
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/core.py", line 160, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/core.py", line 306, in _pyroInvoke
    msg = Message.recv(self._pyroConnection, [Pyro4.message.MSG_RESULT])
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/message.py", line 160, in recv
    msg = cls.from_header(connection.recv(cls.header_size))
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/socketutil.py", line 456, in recv
    return receiveData(self.sock, size)
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/socketutil.py", line 193, in receiveData
    raise err
Pyro4.errors.ConnectionClosedError: receiving: not enough data

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "stockmarket.py", line 63, in <module>
    main()
  File "stockmarket.py", line 53, in main
    ns = Pyro4.locateNS()
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/naming.py", line 340, in locateNS
    raise e
Pyro4.errors.NamingError: Failed to locate the nameserver
legezam <at> ubuntu:~/PycharmProjects/PyroTutorial$ python3 stockmarket.py 
Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/naming.py", line 334, in locateNS
    proxy.ping()
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/core.py", line 160, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/core.py", line 306, in _pyroInvoke
    msg = Message.recv(self._pyroConnection, [Pyro4.message.MSG_RESULT])
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/message.py", line 160, in recv
    msg = cls.from_header(connection.recv(cls.header_size))
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/socketutil.py", line 456, in recv
    return receiveData(self.sock, size)
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/socketutil.py", line 193, in receiveData
    raise err
Pyro4.errors.ConnectionClosedError: receiving: not enough data

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "stockmarket.py", line 63, in <module>
    main()
  File "stockmarket.py", line 53, in main
    ns = Pyro4.locateNS()
  File "/usr/local/lib/python3.3/dist-packages/Pyro4/naming.py", line 340, in locateNS
    raise e
Pyro4.errors.NamingError: Failed to locate the nameserver

I have tried it with ufw disabled and enabled with corresponding rules, and still no change. The interesting part is that the warehouse example (with servesimple) works exactly as it is descripted in the tutorial. (with nameserver turned on)
The stockmarket stucks at the line: locateNS().

Environment: Ubuntu 64 desktop in VMWare workstation

I am really new to this, please help me!

Thank You in advance!

Regards,
Marcell Legeza
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Irmen de Jong | 17 Feb 23:36 2014
Picon

Pyro 4.24 released! (note: has backward-incompatible config item change)


Hi,

Pyro 4.24 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:

Python 3.4 compatibility added (fixed pickle/marshal issues)
a backwards incompatible change has been implemented regarding the threadpool
implementation and configuration, see next two items.
threadpool is now again a fixed size determined by the new THREADPOOL_SIZE config
item (defaults to 16)
config items removed: THREADPOOL_MINTHREADS, THREADPOOL_MAXTHREADS,
THREADPOOL_IDLETIMEOUT
daemon no longer sends an exception response when a communication error occurred
(such as a timeout). This fixes the MSG_PING/disconnect example on linux
jython: multiplex server type now available (uses select based multiplexing). Be
wary, this has not been tested much. When in doubt, use the thread server type.
python wheel distribution format support added (universal, setup.cfg)
merged name server initd script improvements that were made for the Debian package
(easy enable/disable, use sh instead of bash, etc)

Have fun!

Irmen de Jong
Frédéric | 17 Feb 12:59 2014

Porting Pyro to micropython

Hi there,

Some years ago (back to 2003), I started a software based on Pyro to
control a big instrument, in a french research institute (ILL¹).

This software is split in 3 parts: a Pyro server is running on an embedded
system (VME card running linux), where we wrote some low-level task to
drive the instrument. On a desktop computer, we wrote another Pyro server,
which is itself a client of the embedded Pyro server; this second server
implements high level tasks, and is itself used by clients which send
commands, and receive results. These clients are mainly console oriented,
based on ipython.

This software is still running fine for all these years, almost 24/7/365:
Pyro was a really good choice :o)

I recently discovered a great project: micropython². It is a python
interpreter for micro-controller (stm32f4xx). This project is amazing! I
ordered 4 boards (not yet delivered, as Damien, the developer, is still
working on it), and I will use them to replace my Arduino boards ;o)

So, why not porting Pyro to micropython? This would be great to be able to
write low-level code on the pyboard, which has limited ressources, and is
more I/O oriented, and then have a higher-level code running on a
desktop-like computer. Mostly what we did to drive our intruments ;o)

The question is: can Pyro run on micropython? I don't think it is possible
to port the complete server code, but having some basic Pyro core running
should be great, even if we don't maintain compatibility with official
Pyro project ; some fork would be OK too.

What do you think? I already have a non-official board running micropython
(STM32F4-Discovery), so I can start making some tests. Where should I
start? Which part of the code should I dig into?

Thanks for you help,

¹ http://www.ill.eu
² http://www.micropython.org

PS: as micropython implements python3 language, I guess it is better to
use Pyro4.

--

-- 
    Frédéric

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyro-core
Irmen de Jong | 14 Feb 23:41 2014
Picon

python 3.4 compatibility

Hi,

I've tried to run Pyro on Python 3.4.0-RC1 and discovered some issues related to the new
pickle protocol. They seem rather minor but require a new Pyro version to deal with
them. So, if you are planning to use Pyro on Python 3.4 you'll have to use version 4.24
or newer (which is not released yet, but I've already pushed the necessary fixes).

I am not aware of other issues, but have only ran the unit test suite. So I may have
missed something. Please report here (or on the github issue tracker) if you discover an
problem yourself when using python 3.4 with pyro. Thanks!

Cheers
Irmen de Jong

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
Richard van Bemmelen | 11 Feb 22:25 2014
Picon

Are decorators supported?

I am trying to add a function to an instance of a Pyro4 object, like so:



def addto(instance):
    def decorator(f):
        import types
        f = types.MethodType(f, instance, instance.__class__)
        setattr(instance, f.func_name, f)
        return f
    return decorator

cs = Pyro4.Proxy("PYRONAME:example.cserv")

<at> addto(cs)
def getInit(self):
    print self.initCsd
    return self.initCsd
 

print getInit()

This code is running in a client.
It should print the content of self.initCsd on the server and on the client.
Instead, I get this on the client (nothing on the server):

<Pyro4.core._RemoteMethod object at 0x105523dd0>
<Pyro4.core._RemoteMethod object at 0x105523dd0>

So, is this supported?

Richard

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Richard van Bemmelen | 1 Feb 09:35 2014
Picon

message used serializer that is not accepted: 4

Hello,

I would like to use pickle as serializer, because I have to serialize classes.
I've enabled pickle in the client and the server using the suggestions on this forum, but still get this error message.

Pyro4.configuration shows:
SERIALIZER = pickle
SERIALIZERS_ACCEPTED = set(['json', 'pickle', 'marshal', 'serpent'])

What could be wrong here?


Richard van Bemmelen
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Irmen de Jong | 22 Jan 23:01 2014
Picon

Pyro 4.23 released!


Hi,

Pyro 4.23 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:
 - Pyro4.test.echoserver now correctly runs the NS?s broadcast server as well
 - unix domain socket creation no longer fails when bind or connect address is unicode
instead of str
 - docs: added more info on dealing with new serialization configuration in existing code
 - docs: improved name server documentation on registering objects
 - docs: various small updates

There's not really a lot going on in this release, but as usual the complete change
log can be found in the documentation.

Have fun!

Irmen de Jong
Richard van Bemmelen | 14 Jan 22:20 2014
Picon

How to get the value of a remote class object?

This may look trivial. I have a server running on another machine. It is a class with some functions and properties, like .status. ( a string)
In a client I would like to print this value, but I get:
<Pyro4.core._RemoteMethod object at 0x101adbb50>

Am I overlooking something?

Richard

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Pyro-core mailing list
Pyro-core@...
https://lists.sourceforge.net/lists/listinfo/pyro-core
Abhishek Dwaraki | 15 Dec 22:46 2013
Picon

Custom Class Serialization with Serpent.

Hey folks,
             I have gone through the Pyro documentation and even the tutorials. I implemented a Pyro example for my work.
Unfortunately, I am getting a Protocol Error saying that the class is unsupported.

I did try to convert the received object back to the proper types, but it still throws the error. The only
“unsupported” type I have in my object is Python 3.3’s new IPv4 address object (well, the one that
the built in module supports).

The serialization is working in Pickle but not with Serpent. Can someone point me in the right direction? Or
am I doing something blatantly wrong and not realizing it?

Regards,
Abhishek.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

Gmane