Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/logilab/common/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pyc

�
�d{Tc@swdZdZddlmZmZddlZdad�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�ZdS(s<A set of utility function to ease the use of OmniORBpy.




srestructuredtext eni����(tCORBAtPortableServerNcCs7tdkr3ddl}tj|jtj�antS(s�
    returns a reference to the ORB.
    The first call to the method initialized the ORB
    This method is mainly used internally in the module.
    i����N(torbtNonetsysRtORB_inittargvtORB_ID(R((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytget_orbscCsFt�}|jd�}|jtj�}|dk	sBtd��|S(sq
    returns a reference to the NameService object.
    This method is mainly used internally in the module.
    tNameServices$Failed to narrow root naming contextN(Rtresolve_initial_referencest_narrowt	CosNamingt
NamingContextRtAssertionError(RtnsstrootContext((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytget_root_context,s
	cCst�}x�|d D]�\}}tj||�g}y|j|�}Wqtjjk
r�}|j|�jtj�}|dk	s�t	d��qXqW|d\}}tj||�g}y|j
||j��Wn/tjjk
r}|j||j��nXdS(s
    Registers a object in the NamingService.
    The name path is a list of 2-uples (id,kind) giving the path.

    For instance if the path of an object is [('foo',''),('bar','')],
    it is possible to get a reference to the object using the URL
    'corbaname::hostname#foo/bar'.
    [('logilab','rootmodule'),('chatbot','application'),('chatter','server')]
    is mapped to
    'corbaname::hostname#logilab.rootmodule/chatbot.application/chatter.server'

    The get_object_reference() function can be used to resolve such a URL.
    i����s.test context exists but is not a NamingContextN(
RRt
NameComponenttbind_new_contextR
tAlreadyBoundtresolveRRRtbindt_thistrebind(tobjecttnamepathtcontexttidtkindtnametex((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytregister_object_name8s	cCs2t�}|jd�}|j�}|j�dS(s�
    This methods activates the Portable Object Adapter.
    You need to call it to enable the reception of messages in your code,
    on both the client and the server.
    tRootPOAN(RR
t_get_the_POAManagertactivate(Rtpoat
poaManager((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytactivate_POAWs	cCst�j�dS(sc
    Enters the ORB mainloop on the server.
    You should not call this method on the client.
    N(Rtrun(((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytrun_orbbscCst�j|�S(sg
    Resolves a corbaname URL to an object proxy.
    See register_object_name() for examples URLs
    (Rtstring_to_object(turl((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytget_object_referenceiscCs9djg|D]}dj|�^q
�}d||fS(srgiven an host name and a name path as described in register_object_name,
    return a corba string identifier
    t/t.scorbaname::%s#%s(tjoin(thostRtpath_elttstrname((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pytget_object_stringps+(t__doc__t
__docformat__tomniORBRRRRRRRR R&R(R+R2(((sJ/opt/alt/python27/lib/python2.7/site-packages/logilab/common/corbautils.pyt<module>s