Package rdkit :: Package VLib :: Module Output :: Class OutputNode

[hide private]
[frames] | no frames]

# Class OutputNode

source code

       object --+
                |
    Node.VLibNode --+
                    |
                   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 help(type(x)) 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__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

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 help(type(x)) 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)