By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

RPCXML hide implementation.

P: n/a
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
Aug 26 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
xSimple code:
xclass 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
xclass
x return "two"

xServer.register_instance(RpcClass())

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

Skip
Aug 26 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.