Changeset 584 for cly/trunk/cly/builder.py
- Timestamp:
- 07/28/08 00:46:25 (4 months ago)
- Files:
-
- cly/trunk/cly/builder.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/builder.py
r583 r584 431 431 default is to use the content of self.help(). 432 432 433 Arguments: 434 435 :text: Text entered so far. 433 :param text: Text entered so far. 436 434 437 435 >>> grammar = Grammar(one=Node(), two=Node()) … … 448 446 """Find a Node by path rooted at this node. 449 447 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. 453 450 454 451 >>> top = Node(name='top', one=Node(), … … 494 491 will be preserved and the merging nodes children merged. 495 492 496 Arguments: 497 498 :node: Node to merge into this. 493 :param node: Node to merge into this. 499 494 """ 500 495 self.__anonymous_children += node.__anonymous_children … … 520 515 :param value: Value to cast. 521 516 522 :r type: Tuple of (value, options) where options is a dictionary of523 extra Node constructor arguments.517 :returns: Tuple of (value, options) where options is a dictionary of 518 extra Node constructor arguments. 524 519 """ 525 520 casts = { … … 647 642 """Group subnodes under a single group ID. 648 643 649 Arguments: 650 :id: Group ID. 644 :param id: Group ID. 651 645 """ 652 646 def __init__(self, id=None, *args, **kwargs): … … 666 660 are supported. 667 661 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. 673 665 674 666 >>> from cly.parser import Parser, Context … … 739 731 A node that masquerades as its children, if a condition is true. 740 732 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. 745 735 746 736 All other arguments are passed through to the default :class:`Node` constructor. … … 809 799 """Matches EOL and executes ``callback``. 810 800 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. 821 806 822 807 >>> from cly.parser import Parser, Context
