fix line read-ins for stdin
diff --git a/turbo_hipster/lib/utils.py b/turbo_hipster/lib/utils.py
index e2762ae..d0bca0b 100644
--- a/turbo_hipster/lib/utils.py
+++ b/turbo_hipster/lib/utils.py
@@ -108,7 +108,8 @@
descriptors[p.stdout.fileno()] = dict(
name='[output]',
- poll=(select.POLLIN | select.POLLHUP)
+ poll=(select.POLLIN | select.POLLHUP),
+ lines=''
)
poll_obj = select.poll()
@@ -121,7 +122,7 @@
""" Write the fd to log """
descriptors[fd]['lines'] += os.read(fd, 1024 * 1024)
# Avoid partial lines by only processing input with breaks
- if lines[fd].find('\n') != -1:
+ if descriptors[fd]['lines'].find('\n') != -1:
elems = descriptors[fd]['lines'].split('\n')
# Take all but the partial line
for l in elems[:-1]: