Changeset 584

Show
Ignore:
Timestamp:
07/28/08 00:46:25 (4 months ago)
Author:
athomas
Message:

Docstring updates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cly/trunk/cly/builder.py

    r583 r584  
    431431        default is to use the content of self.help(). 
    432432 
    433         Arguments: 
    434  
    435             :text: Text entered so far. 
     433        :param text: Text entered so far. 
    436434 
    437435        >>> grammar = Grammar(one=Node(), two=Node()) 
     
    448446        """Find a Node by path rooted at this node. 
    449447 
    450         Arguments: 
    451  
    452             :path: "Path" to the node, or a label. 
     448        :param path: "Path" to the node, or a label. 
     449        :returns: Found node. 
    453450 
    454451        >>> top = Node(name='top', one=Node(), 
     
    494491        will be preserved and the merging nodes children merged. 
    495492 
    496         Arguments: 
    497  
    498             :node: Node to merge into this. 
     493        :param node: Node to merge into this. 
    499494        """ 
    500495        self.__anonymous_children += node.__anonymous_children 
     
    520515        :param value: Value to cast. 
    521516 
    522         :rtype: Tuple of (value, options) where options is a dictionary of 
    523                 extra Node constructor arguments. 
     517        :returns: Tuple of (value, options) where options is a dictionary of 
     518                  extra Node constructor arguments. 
    524519        """ 
    525520        casts = { 
     
    647642    """Group subnodes under a single group ID. 
    648643 
    649     Arguments: 
    650         :id: Group ID. 
     644    :param id: Group ID. 
    651645    """ 
    652646    def __init__(self, id=None, *args, **kwargs): 
     
    666660    are supported. 
    667661 
    668     Arguments: 
    669  
    670         :target: 
    671             Relative or absolute path to the aliased node. If the alias contains 
    672             glob characters (``*`` or ``?``) all matching nodes are aliased. 
     662    :param target: 
     663        Relative or absolute path to the aliased node. If the alias contains 
     664        glob characters (``*`` or ``?``) all matching nodes are aliased. 
    673665 
    674666    >>> from cly.parser import Parser, Context 
     
    739731    A node that masquerades as its children, if a condition is true. 
    740732 
    741     Arguments: 
    742  
    743         :test: A callable with the signature ``test(context)``. 
    744                Returns ``True`` if masqueraded nodes are accessible. 
     733    :param test: A callable with the signature ``test(context)``. 
     734                 Returns ``True`` if masqueraded nodes are accessible. 
    745735 
    746736    All other arguments are passed through to the default :class:`Node` constructor. 
     
    809799    """Matches EOL and executes ``callback``. 
    810800 
    811     Arguments: 
    812  
    813         :callback: Callback to execute when the action is chosen. 
    814  
    815     Attributes: 
    816  
    817         .. attribute:: with_context 
    818  
    819             If True, passes the current parse :class:`~cly.parser.Context` as the 
    820             first argument. 
     801    :param callback: Callback to execute when the action is chosen. 
     802 
     803    :var with_context: 
     804        If True, passes the current parse :class:`~cly.parser.Context` as the 
     805        first argument. 
    821806 
    822807    >>> from cly.parser import Parser, Context 
  • cly/trunk/cly/console.py

    r583 r584  
    479479    """Print a list of lists as a table, so that columns line up nicely. 
    480480 
    481     Arguments: 
    482         :header: List of column headings. Will be printed as the first row. 
    483  
    484         :table: List of lists for the table body. 
    485         :sep: The column separator. 
    486         :indent: Table indentation as a string. 
    487         :header_format: Formatting to use for header. 
    488         :row_format: A tuple specifying cycling formatting colours to use for 
    489                      each row. 
    490         :expand_to_fit: If a boolean, signifies whether print_table should 
    491                         expand the table to the width of the terminal or 
    492                         compact it as much as possible. If an integer, 
    493                         specifies the width to expand to. 
    494         :min_widths: Columns will be guaranteed to be at least the width of 
    495                      each element in this list. May also be a dictionary of 
    496                      column indices to widths. 
    497         :term_width: Specify the terminal width. 
    498  
    499     :returns: 
    500         Stuff. 
     481    :param header: List of column headings. Will be printed as the first row. 
     482    :param table: List of lists for the table body. 
     483    :param sep: The column separator. 
     484    :param indent: Table indentation as a string. 
     485    :param header_format: Formatting to use for header. 
     486    :param row_format: A tuple specifying cycling formatting colours to use for 
     487                       each row. 
     488    :param expand_to_fit: If a boolean, signifies whether print_table should 
     489                          expand the table to the width of the terminal or 
     490                          compact it as much as possible. If an integer, 
     491                          specifies the width to expand to. 
     492    :param min_widths: Columns will be guaranteed to be at least the width of 
     493                       each element in this list. May also be a dictionary of 
     494                       column indices to widths. 
     495    :param term_width: Override terminal width detection. 
     496 
     497    :returns: List of strings, one per line. 
    501498 
    502499    Note: In addition to the normal formatting codes supported by :func:`cprint`,