ó
|c‹Ac           @   s-   d  Z  d d l m Z d d d „  ƒ  YZ d S(   s?    RoleSpec class
    http://www.topicmaps.org/xtm/#elt-roleSpec
iÿÿÿÿ(   t   TopicReft   RoleSpecc           B   s>   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z d „  Z RS(   sG    RoleSpec class
        http://www.topicmaps.org/xtm/#elt-roleSpec
    c         C   s)   g  |  _  | r% |  j t | ƒ ƒ n  d S(   sI   Initialize RoleSpec object. (id=None) - Add TopicRef object with given idN(   t	   _childrent   setTopicRefR    (   t   selft   id(    (    s   lib/xtm/RoleSpec.pyt   __init__   s    	 c         C   s   |  j  | ƒ d S(   s   Add TopicRef objectN(   t   addChild(   R   t   topicRef(    (    s   lib/xtm/RoleSpec.pyR      s    c         C   sI   g  |  j  D] } t | t ƒ r
 | ^ q
 } | r> | d g pD d g d S(   s   Return TopicRef object or "" i    t    (   R   t
   isinstanceR    (   R   R   t   topicRefChildren(    (    s   lib/xtm/RoleSpec.pyt   getTopicRef   s    +c         C   s   |  j  j | ƒ d S(   s   Add object (:TopicRef)N(   R   t   append(   R   t   child(    (    s   lib/xtm/RoleSpec.pyR      s    c         C   s   d |  j  ƒ  S(   s0   Return XTM:str representation of RoleSpec objects   <roleSpec>%s</roleSpec>(   R   (   R   (    (    s   lib/xtm/RoleSpec.pyt   __str__   s    N(	   t   __name__t
   __module__t   __doc__t   NoneR   R   R   R   R   (    (    (    s   lib/xtm/RoleSpec.pyR   	   s   			N(    (   R   t   xtm.TopicRefR    R   (    (    (    s   lib/xtm/RoleSpec.pyt   <module>   s   