rdkit.VLib.Output.OutputNode

Package rdkit :: Package VLib :: Module Output :: Class OutputNode |
[hide private]
[frames] | no frames]

# Class OutputNode

source code

       object --+
                |
    Node.VLibNode --+
                    |
                   OutputNode

Known Subclasses:
  - NodeLib.SmilesOutput.OutputNode

    base class for nodes which dump output

    Assumptions:

      - destination supports a write() method

      - strFunc, if provided, returns a string representation of
        the input

      - inputs (parents) can be stepped through in lockstep

    Usage Example:
      >>> from rdkit.VLib.Supply import SupplyNode
      >>> supplier = SupplyNode(contents=[1,2,3])
      >>> import StringIO
      >>> io = StringIO.StringIO()
      >>> node = OutputNode(dest=io,strFunc=lambda x:'%s '%(str(x)))
      >>> node.AddParent(supplier)
      >>> node.next()
      1
      >>> io.getvalue()
      '1 '
      >>> node.next()
      2
      >>> io.getvalue()
      '1 2 '

Instance Methods | [hide private]
__init__(self, dest=None, strFunc=None, **kwargs) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
next(self) part of the iterator interface | source code
Inherited from `Node.VLibNode`: `AddChild`, `AddParent`, `Destroy`, `GetChildren`, `GetParents`, `RemoveChild`, `RemoveParent`, `__iter__`, `reset` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, dest=None, strFunc=None, **kwargs) (Constructor) | source code
    x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__ (inherited documentation)

### next(self) | source code
    part of the iterator interface

    raises StopIteration on failure
Overrides: Node.VLibNode.next (inherited documentation)