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

type OutputNode

source code

   object --+    
            |    
Node.VLibNode --+
                |
               OutputNode
Known Subclasses:

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])
  >>> from rdkit.six import StringIO
  >>> sio = StringIO()
  >>> node = OutputNode(dest=sio,strFunc=lambda x:'%s '%(str(x)))
  >>> node.AddParent(supplier)
  >>> node.next()
  1
  >>> sio.getvalue()
  '1 '
  >>> node.next()
  2
  >>> sio.getvalue()
  '1 2 '

Instance Methods [hide private]
 
__init__(self, dest=None, strFunc=None, **kwargs) source code
 
__next__(self)
part of the iterator interface
source code
 
next(self)
part of the iterator interface
source code

Inherited from Node.VLibNode: AddChild, AddParent, Destroy, GetChildren, GetParents, RemoveChild, RemoveParent, __iter__, reset

Method Details [hide private]

__init__(self, dest=None, strFunc=None, **kwargs)
(Constructor)

source code 
Overrides: Node.VLibNode.__init__

__next__(self)

source code 
part of the iterator interface

raises StopIteration on failure

Overrides: Node.VLibNode.next
(inherited documentation)

next(self)

source code 
part of the iterator interface

raises StopIteration on failure

Overrides: Node.VLibNode.next
(inherited documentation)