X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fclient%2Fsfaclientlib.py;h=2b5cb1992e3e6436e3ea66f5debe0136c639489b;hb=935de64c2ed3a68566da471c68447a1ac384455d;hp=ba8f502da36dd9adc3cea793b8c9b1d559f8187f;hpb=205bc659a512d77edd19358f724209983225bc43;p=sfa.git diff --git a/sfa/client/sfaclientlib.py b/sfa/client/sfaclientlib.py index ba8f502d..2b5cb199 100644 --- a/sfa/client/sfaclientlib.py +++ b/sfa/client/sfaclientlib.py @@ -7,35 +7,10 @@ import os,os.path import sfa.util.sfalogging -# what we use on GID actually is inherited from Certificate -#from sfa.trust.gid import GID +from sfa.client.sfaserverproxy import SfaServerProxy + +# see optimizing dependencies below from sfa.trust.certificate import Keypair, Certificate -# what we need in the Credential class essentially amounts to saving the incoming result -# in a file as the output from the registry already is under xml format -#from sfa.trust.credential import Credential - -import sfa.client.sfaprotocol as sfaprotocol - -class SfaServerProxy: - - def __init__ (self, url, keyfile, certfile, verbose=False, timeout=None): - self.url=url - self.keyfile=keyfile - self.certfile=certfile - self.verbose=verbose - self.timeout=timeout - # an instance of xmlrpclib.ServerProxy - self.serverproxy=sfaprotocol.server_proxy \ - (self.url, self.keyfile, self.certfile, self.timeout, self.verbose) - - # this is python magic to return the code to run when - # SfaServerProxy receives a method call - # so essentially we send the same method with identical arguments - # to the server_proxy object - def __getattr__(self, name): - def func(*args, **kwds): - return getattr(self.serverproxy, name)(*args, **kwds) - return func ########## # a helper class to implement the bootstrapping of crypto. material