Skip to content

Commit

Permalink
tweet plugin seems to work in the background as well now
Browse files Browse the repository at this point in the history
  • Loading branch information
mfiers committed Jun 17, 2012
1 parent 361e9e6 commit e58f0d3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/python/moa/plugin/system/twit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
from datetime import datetime, timedelta
import subprocess as sp

import moa.logger
l = moa.logger.getLogger(__name__)
import moa.ui

from moa.sysConf import sysConf

def niceRunTime(d):
Expand Down Expand Up @@ -76,6 +80,14 @@ def hook_postRun():
niceRunTime(runtime))

#start TTYter process
P = sp.Popen(['ttytter', '-script'], stdin=sp.PIPE)
P.communicate(message)
moa.ui.message('Sending tweet', store=False)
P = sp.Popen(['ttytter', '-script'], stdin=sp.PIPE,stdout=sp.PIPE, stderr=sp.PIPE, shell=True)
moa.ui.message('Message ' + message)
o,e = P.communicate(message)
with open('twitt.log', 'a') as F:
F.write('\n\noo\n')
F.write(o)
F.write('\n\nee\n')
F.write(e)


0 comments on commit e58f0d3

Please sign in to comment.