: capability to use @property for remote object

Andrii Pavlyk <[email protected]> Tue, 5 Nov 2013 08:50:18 +0000
Newsgroups gmane.comp.python.pyro
Message-ID <ABE667589B7C9F42B8F451A0BD06AF3A6BCBF9B7@WAL-MBS03.global.avidww.com>
Hello,

Could you, please, help me to resolve issue I encountered trying to use Pyro?

I perform the following code
on server:

import Pyro4

class CTestClassWProperty(object):

    def __init__(self):
        super().__init__()

        self.__test_property = "Value to check"

    @property
    def test_property(self):
        return self.__test_property

    def print_test_property(self):
        print("The test property is '{}'".format(self.test_property))
        return self.test_property

if __name__ == '__main__':
    class_w_property=CTestClassWProperty()
    daemon=Pyro4.Daemon()
    uri=daemon.register(class_w_property)
    print("Ready. Object uri = {}".format(uri))
    daemon.requestLoop()

on client:

import Pyro4

uri=input("What is the Pyro uri of the class with property object? ").strip()

class_w_property=Pyro4.Proxy(uri)
print(class_w_property.test_property)
print(class_w_property.print_test_property())

The output of client code is below:

<Pyro4.core._RemoteMethod object at 0x0000000002AB1128>
Value to check

So, as you can see, when get the CTestClassWProperty @property with no Pyro there is its value printed out.
When get the @property for Pyro object of the corresponding class there is _RemoteMethod object printed out instead of this property's value.

Therefore question is
How to use @property of classes via their Pyro object with no any changes in remote class?


Thanks for your help.

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk

_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core