Changeset 11 for trunk/python


Ignore:
Timestamp:
May 30, 2005 9:33:49 PM (19 years ago)
Author:
mmc
Message:

Major reorganization of the entire package. The config.xml file
is now irrelevant. All the action is in the tool.xml file. The
main program now organizes all input into 1) side-by-side pages,
2) input/result (wizard-style) pages, or 3) a series of wizard-
style pages. The <input> can have <phase> parts representing
the various pages.

Added a new ContourResult? widget based on Swaroop's vtk plotting
code.

Also, added easymesh and showmesh to the "tools" directory.
We need these for Eric Polizzi's code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/Rappture/library.py

    r6 r11  
    4040
    4141    # ------------------------------------------------------------------
    42     def element(self, path="", flavor="object"):
     42    def element(self, path="", as="object"):
    4343        """
    4444        Clients use this to query a particular element within the
     
    5151        By default, this method returns an object representing the
    5252        DOM node referenced by the path.  This is changed by setting
    53         the "flavor" argument to "id" (for name of the tail element),
     53        the "as" argument to "id" (for name of the tail element),
    5454        to "type" (for the type of the tail element), to "component"
    5555        (for the component name "type(id)"), or to "object"
     
    6161            return None
    6262
    63         if flavor == 'object':
     63        if as == 'object':
    6464            return library(node)
    65         elif flavor == 'component':
     65        elif as == 'component':
    6666            return self._node2comp(node)
    67         elif flavor == 'id':
     67        elif as == 'id':
    6868            return self._node2name(node)
    69         elif flavor == 'type':
     69        elif as == 'type':
    7070            return node.tagName
    7171
    72         raise ValueError, "bad flavor '%s': should be object, id, type" % flavor
    73 
    74     # ------------------------------------------------------------------
    75     def children(self, path="", flavor="object", type=None):
     72        raise ValueError, "bad as value '%s': should be component, id, object, type" % as
     73
     74    # ------------------------------------------------------------------
     75    def children(self, path="", as="object", type=None):
    7676        """
    7777        Clients use this to query the children of a particular element
     
    8383
    8484        By default, this method returns a list of objects representing
    85         the children.  This is changed by setting the "flavor" argument
     85        the children.  This is changed by setting the "as" argument
    8686        to "id" (for tail names of all children), to "type" (for the
    8787        types of all children), to "component" (for the path component
     
    9999            nlist = [n for n in nlist if n.nodeName == type]
    100100
    101         if flavor == 'object':
     101        if as == 'object':
    102102            return [library(n) for n in nlist]
    103         elif flavor == 'component':
     103        elif as == 'component':
    104104            return [self._node2comp(n) for n in nlist]
    105         elif flavor == 'id':
     105        elif as == 'id':
    106106            return [self._node2name(n) for n in nlist]
    107         elif flavor == 'type':
     107        elif as == 'type':
    108108            return [n.tagName for n in nlist]
     109
     110        raise ValueError, "bad as value '%s': should be component, id, object, type" % as
    109111
    110112    # ------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.