Skip to content

Commit

Permalink
And fixing paths again.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderanger committed Jun 7, 2012
1 parent cca97f0 commit 9b4b381
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
setup(
name = 'supervisor-stdout',
version = '0.1.1',
packages = ['supervisor-stdout'],
py_modules = ['supervisor_stdout'],

author = 'Noah Kantrowitz',
author_email = 'noah@coderanger.net',
Expand Down
25 changes: 25 additions & 0 deletions supervisor_stdout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sys

def write_stdout(s):
sys.stdout.write(s)
sys.stdout.flush()

def write_stderr(s):
sys.stderr.write(s)
sys.stderr.flush()

def main():
while 1:
write_stdout('READY\n') # transition from ACKNOWLEDGED to READY
line = sys.stdin.readline() # read header line from stdin
headers = dict([ x.split(':') for x in line.split() ])
data = sys.stdin.read(int(headers['len'])) # read the event payload
write_stdout('RESULT %s\n%s'%(len(data), data)) # transition from READY to ACKNOWLEDGED

def event_handler(event, response):
line, data = response.split('\n', 1)
headers = dict([ x.split(':') for x in line.split() ])
print '%s %s | %s'%(headers['processname'], headers['channel'], data),

if __name__ == '__main__':
main()
Empty file removed supervisor_stdout/__init__.py
Empty file.

0 comments on commit 9b4b381

Please sign in to comment.