RPCXML hide implementation.

X

x_O

Hi

I'm working recently with XMLRPC for python and It never was so easy.

But I've meet a obstacle. Because python is not giving us any
reasonable encapsulation mechanism, I have problems with hiding some
part of the implementation.

When class has 2 methods and I want to make rpc private only ONE of
them. I can always use __name. But what in case when I really need to
use those two methods inside other class as a public, but not by RPC

Simple code:
class RpcClass:
def one(self): #visible by RPC, available as public for other class
return "one"
def two(self): #INVISIBLE by RPC, available as public for other
class
return "two"

Server.register_instance(RpcClass())

Thanks
 
S

skip

x> Simple code:
x> class RpcClass:
x> def one(self): #visible by RPC, available as public for other class
x> return "one"
x> def two(self): #INVISIBLE by RPC, available as public for other
x> class
x> return "two"

x> Server.register_instance(RpcClass())

Just register the method you want to publish, not the entire instance.

Skip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top