Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/ui/model/registration/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyc

ó
ÍÿŠTc@s>ddlZddljjjjZdefd„ƒYZdS(iÿÿÿÿNtRegistrationProxycBsteZdZd
d
d
d
d
d
d
d„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd	„ZRS(sà
    L{RegistrationProxy} allows the use of the L{RegistrationMechanism} via
    DBus without having to know about DBus.  This in turn allows controller
    code to remain agnostic to the implementation of registration.
    cCsYd|_d|_||_||_||_||_||_||_|j	|ƒdS(N(
tNonet_bust
_interfacet_on_register_notifyt_on_register_errort_on_register_succeedt_on_register_failt_on_disable_succeedt_on_disable_failt_setup_interface(tselfton_register_notifyton_register_errorton_register_succeedton_register_failton_disable_succeedton_disable_failtbus((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyt__init__
s								cCsd|dkrtjƒ|_n	||_|jjtjtjƒ|_tj	|jtj
ƒ|_dS(s€
        Redefining L{_setup_interface} allows us to bypass DBus for more
        convenient testing in some instances.
        N(Rtdbust	SystemBusRt
get_objectt	mechanismtSERVICE_NAMEtOBJECT_PATHt_remote_objectt	InterfacetINTERFACE_NAMER(RR((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyR
s	cs‡‡fd†}|S(Ncsˆjƒˆ|ƒdS(N(t_remove_handlers(tmessage(Rtexit_handler(sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pytwrapped_exit_handler*s
((RRR ((RRsI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyt_exit_handler_wrapper(scCsçg|_|jrR|jj|jj|jdddtjdddtjƒƒn|j	r›|jj|jj|j	dddtjdddtjƒƒn|j
rí|jj|jj|j|j
ƒdddtjdddtjƒƒn|jr?|jj|jj|j|jƒdddtjdddtjƒƒn|j
r‘|jj|jj|j|j
ƒdd	dtjdddtjƒƒn|jrã|jj|jj|j|jƒdd
dtjdddtjƒƒndS(Ntsignal_nametregister_notifytdbus_interfacetbus_nametpathtregister_errortregister_succeedt
register_failtdisable_succeedtdisable_fail(t	_handlersRtappendRtadd_signal_receiverRRRRRRR!RRR	(R((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyt_register_handlers0sb																											cCs(x!|jD]}|jj|ƒq
WdS(N(R,Rtremove_signal_receiver(Rthandler((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyRcscCs
|jjƒS(N(Rt	challenge(R((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyR2gscCs‡|jƒy|jj|ƒ\}}Wn:tjk
rb}|jƒdkrS‚qct}d}nX|rv|jƒn
|j|ƒ|S(Ns"org.freedesktop.DBus.Error.NoReplysRegistration timed out.(	R/RtregisterRt
DBusExceptiont
get_dbus_nametFalseRR(Rtconfig_pathtresultRte((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyR3js



cCs:|jƒ|jjƒ}|r,|jƒn
|jƒ|S(N(R/RtdisableRR	(RR8((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyR:zs


cCsFy|jjƒWn.tjk
rA}|jƒdkrB‚qBnXdS(s.
        Cause the mechanism to exit.
        s"org.freedesktop.DBus.Error.NoReplyN(RtexitRR4R5(RR9((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyR;ƒs
N(
t__name__t
__module__t__doc__RRR
R!R/RR2R3R:R;(((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyRs			3					(Rt)landscape.ui.model.registration.mechanismtuitmodeltregistrationRtobjectR(((sI/usr/lib/python2.7/dist-packages/landscape/ui/model/registration/proxy.pyt<module>s