quit hijacking stderr for the python process id, just write it straight to the file

This commit is contained in:
Travis Parker 2009-04-29 12:10:46 -07:00
parent 506bc1ad6e
commit 982e165d0e
2 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,9 @@ class Handlers(object):
def main():
print >> sys.stderr, "%d\n" % os.getpid()
fp = open(sys.argv[1], 'a')
fp.write("%d\n" % os.getpid())
fp.close()
h = Handlers()
notifier_init()
try:

View File

@ -3,11 +3,11 @@
DIR=$HOME/.mcabber
pidtail() {
tail -F $1 &
tail -F $1 2>/dev/null &
echo $! 1>&2
}
echo -n > $DIR/notify_pids
echo -n > $DIR/last_event
(pidtail $DIR/last_event 2>> $DIR/notify_pids | python $DIR/mcabbernotify.py 2>> $DIR/notify_pids) &
(pidtail $DIR/last_event 2>> $DIR/notify_pids | python $DIR/mcabbernotify.py $DIR/notify_pids) &
echo $! >> $DIR/notify_pids