ó
|c‹Ac           @   s=   d  Z  d d l m Z d d l m Z d d d „  ƒ  YZ d S(   sA    BaseName class
    http://www.topicmaps.org/xtm/#desc-base-name
iÿÿÿÿ(   t   BaseNameString(   t   Scopet   BaseNamec           B   sP   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   sI    BaseName class
        http://www.topicmaps.org/xtm/#desc-base-name
    c         C   s)   g  |  _  | r% |  j t | ƒ ƒ n  d S(   s?   (name=None) -- initialize BaseName object with a given name:strN(   t	   _childrent   setBaseNameStringR    (   t   selft   name(    (    s   lib/xtm/BaseName.pyt   __init__   s    	 c         C   sI   g  |  j  D] } t | t ƒ r
 | ^ q
 } | r> | d g pD d g d S(   sB   Return BaseNameString object, if such exists (otherwise return "")i    t    (   R   t
   isinstanceR    (   R   t   nameStrt   nameStrChildren(    (    s   lib/xtm/BaseName.pyt   getBaseNameString   s    +c         C   s   |  j  | ƒ d S(   s(   Add object baseNameString:BaseNameStringN(   t   addChild(   R   t   baseNameString(    (    s   lib/xtm/BaseName.pyR      s    c         C   s   |  j  | ƒ d S(   s   Add object scope:ScopeN(   R   (   R   t   scope(    (    s   lib/xtm/BaseName.pyt   setScope   s    c         C   sI   g  |  j  D] } t | t ƒ r
 | ^ q
 } | r> | d g pD d g d S(   s9   Return Scope object, if such exists (otherwise return "")i    R   (   R   R	   R   (   R   R   t   scopeChildren(    (    s   lib/xtm/BaseName.pyt   getScope    s    +c         C   s   |  j  j | ƒ d S(   s6   Add object (:BaseNameString or :Scope) to the BaseNameN(   R   t   append(   R   t   child(    (    s   lib/xtm/BaseName.pyR   %   s    c         C   s   d |  j  ƒ  |  j ƒ  f S(   s0   Return XTM:str representation of BaseName objects   <baseName>%s%s</baseName>(   R   R   (   R   (    (    s   lib/xtm/BaseName.pyt   __str__)   s    N(   t   __name__t
   __module__t   __doc__t   NoneR   R   R   R   R   R   R   (    (    (    s   lib/xtm/BaseName.pyR   
   s   					N(    (   R   t   xtm.BaseNameStringR    t	   xtm.ScopeR   R   (    (    (    s   lib/xtm/BaseName.pyt   <module>   s   