Your IP : 216.73.216.213
B
�d{T[ � @ s� d Z dZddlZddlZddlmZmZmZmZm Z e�
d�Ze� Z
e�� e _e
fdd�Zdd � Zi Zi Zddd�Zd
d� Ze
ddd
fdd�Zdd� Ze
dfdd�Ze
dfdd�Ze
dfdd�Zdd� Zdd� ZdS )aD Python Remote Object utilities
Main functions available:
* `register_object` to expose arbitrary object through pyro using delegation
approach and register it in the nameserver.
* `ns_unregister` unregister an object identifier from the nameserver.
* `ns_get_proxy` get a pyro proxy from a nameserver object identifier.
zrestructuredtext en� N)�core�naming�errors�util�configZpyroc C sd y| � dd�\}}W n, tk
r@ |tkr4tj}n|}| }Y nX |d k r\|�d�s\d| }||fS )N�.� �:)�rsplit�
ValueError�_MARKERr ZPYRO_NS_DEFAULTGROUP�
startswith)Zidstr�defaultnsgroup�nsgroup�nsid� r �H/opt/alt/python37/lib/python3.7/site-packages/logilab/common/pyro_ext.py�ns_group_and_id( s
r c C sD | sdS y| � d�\} }W n tk
r2 d }Y n
X t|�}| |fS )N)NNr )�splitr �int)Zhoststr�portr r r �
host_and_port5 s
r Tc C sR | t krJ|std| ��t s(tjdd� t| �\}}tj||d�}|t | <