Skip to content

Commit 9b4b381

Browse files
committed
And fixing paths again.
1 parent cca97f0 commit 9b4b381

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
setup(
88
name = 'supervisor-stdout',
99
version = '0.1.1',
10-
packages = ['supervisor-stdout'],
10+
py_modules = ['supervisor_stdout'],
1111

1212
author = 'Noah Kantrowitz',
1313
author_email = 'noah@coderanger.net',

supervisor_stdout.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import sys
2+
3+
def write_stdout(s):
4+
sys.stdout.write(s)
5+
sys.stdout.flush()
6+
7+
def write_stderr(s):
8+
sys.stderr.write(s)
9+
sys.stderr.flush()
10+
11+
def main():
12+
while 1:
13+
write_stdout('READY\n') # transition from ACKNOWLEDGED to READY
14+
line = sys.stdin.readline() # read header line from stdin
15+
headers = dict([ x.split(':') for x in line.split() ])
16+
data = sys.stdin.read(int(headers['len'])) # read the event payload
17+
write_stdout('RESULT %s\n%s'%(len(data), data)) # transition from READY to ACKNOWLEDGED
18+
19+
def event_handler(event, response):
20+
line, data = response.split('\n', 1)
21+
headers = dict([ x.split(':') for x in line.split() ])
22+
print '%s %s | %s'%(headers['processname'], headers['channel'], data),
23+
24+
if __name__ == '__main__':
25+
main()

supervisor_stdout/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy