3
AAd]?  ã               @   s,   d Z ddlmZmZmZ G dd„ deƒZdS )z6 The interface for a node in a preferences hierarchy. é    )ÚInstanceÚ	InterfaceÚStrc               @   st   e Zd ZdZeZed ƒZeZddd„Z	dd„ Z
dd	„ Zddd„Zddd„Zddd„Zddd„Zddd„Zdd„ ZdS )ÚIPreferencesz6 The interface for a node in a preferences hierarchy. NFc             C   s   dS )a¡   Get the value of the preference at the specified path.

        If no value exists for the path (or any part of the path does not
        exist) then return the default value.

        Preference values are *always* returned as strings.

        e.g::

          preferences.set('acme.ui.bgcolor', 'blue')
          preferences.get('acme.ui.bgcolor') -> 'blue'

          preferences.set('acme.ui.width', 100)
          preferences.get('acme.ui.width') -> '100'

          preferences.set('acme.ui.visible', True)
          preferences.get('acme.ui.visible') -> 'True'

        If 'inherit' is True then we allow 'inherited' preference values.

        e.g. If we are looking up::

          'acme.ui.widget.bgcolor'

        and it does not exist then we will also try::

          'acme.ui.bgcolor'
          'acme.bgcolor'
          'bgcolor'

        Raise a 'ValueError' exception if the path is the empty string.

        N© )ÚselfÚpathÚdefaultZinheritr   r   ú~/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/apptools-4.4.0-py3.6.egg/apptools/preferences/i_preferences.pyÚget   s    zIPreferences.getc             C   s   dS )a(   Remove the preference at the specified path.

        Does nothing if no value exists for the path (or any part of the path
        does not exist.

        Raise a 'ValueError' exception if the path is the empty string.

        e.g.::

          preferences.remove('acme.ui.bgcolor')

        Nr   )r   r   r   r   r
   Úremove;   s    zIPreferences.removec             C   s   dS )a}   Set the value of the preference at the specified path.

        Any missing nodes are created automatically.

        Primitive Python types can be set, but preferences are *always*
        stored and returned as strings.

        e.g::

          preferences.set('acme.ui.bgcolor', 'blue')
          preferences.get('acme.ui.bgcolor') -> 'blue'

          preferences.set('acme.ui.width', 100)
          preferences.get('acme.ui.width') -> '100'

          preferences.set('acme.ui.visible', True)
          preferences.get('acme.ui.visible') -> 'True'

        Raise a 'ValueError' exception if the path is the empty string.

        Nr   )r   r   Úvaluer   r   r
   ÚsetI   s    zIPreferences.setÚ c             C   s   dS )a²   Remove all preference from the node at the specified path.

        If the path is the empty string (the default) then remove the
        preferences in *this* node.

        This does not affect any of the node's children.

        e.g. To clear the preferences out of a node directly::

          preferences.clear()

        Or to clear the preferences of a node at a given path::

          preferences.clear('acme.ui')

        Nr   )r   r   r   r   r
   Úclearb   s    zIPreferences.clearc             C   s   dS )zô Return the preference keys of the node at the specified path.

        If the path is the empty string (the default) then return the
        preference keys of *this* node.

        e.g::

          keys = preferences.keys('acme.ui')

        Nr   )r   r   r   r   r
   Úkeyst   s    zIPreferences.keysc             C   s   dS )a   Return the node at the specified path.

        If the path is the empty string (the default) then return *this* node.

        Any missing nodes are created automatically.

        e.g::

          node = preferences.node('acme.ui')
          bgcolor = node.get('bgcolor')

        Nr   )r   r   r   r   r
   Únode€   s    zIPreferences.nodec             C   s   dS )zÉ Return True if the node at the specified path exists

        If the path is the empty string (the default) then return True.

        e.g::

          exists = preferences.exists('acme.ui')

        Nr   )r   r   r   r   r
   Únode_existsŽ   s    zIPreferences.node_existsc             C   s   dS )a   Return the names of the children of the node at the specified path.

        If the path is the empty string (the default) then return the names of
        the children of *this* node.

        e.g::

          names = preferences.node_names('acme.ui')

        Nr   )r   r   r   r   r
   Ú
node_names™   s    zIPreferences.node_namesc             C   s   dS )z| Force any changes in the node to the backing store.

        This includes any changes to the node's descendants.

        Nr   )r   r   r   r
   Úflush§   s    zIPreferences.flush)NF)r   )r   )r   )r   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   ÚparentÚnamer   r   r   r   r   r   r   r   r   r   r   r   r
   r      s   
#




r   N)r   Z
traits.apir   r   r   r   r   r   r   r
   Ú<module>   s   