My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
#
# Library: pyflowctrl
# Module: stdoutprinter1
# Dependency: core2, stdiostreams1
#
#

from core2 import Stream, Process, EmptyStream
from streams.stdiostreams1 import StandardOutputStream


class Printer(Process):
def __init__(self):
super(Printer, self).__init__()
self.io = {
'input': Stream(),
'output': StandardOutputStream(),
}

def main(self):
while True:
data = self.io['input'].get()
if not isinstance(data, str):
data = str(data)
self.io['output'].put(data)
yield

Change log

cb42b456b4c0 by ownport <ownport> on Jul 23, 2011   Diff
pytflowctrl: stdoutprinter1.py, removed
not necessary imports
Go to: 
Project members, sign in to write a code review

Older revisions

058fb70f3c3b by ownport <ownport> on Jun 24, 2011   Diff
pyflowctrl: stdoutprinter1 can print
any datatype
236d1dce018c by ownport <ownport> on Jun 24, 2011   Diff
pyflowctrl: TextFileReader, Printer,
example8.py added
All revisions of this file

File info

Size: 648 bytes, 28 lines
Powered by Google Project Hosting