Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (20 sloc) 614 Bytes
#!./tbenv/bin/python
import logging
import sys
from bot_runner import BotRunner
import settings
from talkbackbot import TalkBackBotFactory
logging.basicConfig(filename=settings.LOG_FILE, level=logging.DEBUG)
if __name__ == '__main__':
command = ""
try:
command = sys.argv[1]
except IndexError:
print "No command specified, try start or stop"
exit(1)
runner = BotRunner(settings.PID_FILE, TalkBackBotFactory)
try:
method = getattr(runner, command)
method()
except AttributeError:
print "Unknown command '%s'; try start or stop" % (command)