Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (30 sloc) 963 Bytes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import jabber_bot.client, getopt, sys, os.path
def usage(name):
print "usage: %s -j jid -p password [-d plugins_directory]" % name
if __name__ == '__main__':
try:
optlist, args = getopt.gnu_getopt(sys.argv[1:], "j:p:d:", ["jid=","password=","plugins="])
except getopt.GetoptError, err:
print str(err)
usage(sys.argv[0])
sys.exit(2)
jid=None
password=None
plugins='plugins'
for opt, arg in optlist:
if opt in ('-j', '--jid'):
jid = arg
elif opt in ('-p', '--password'):
password = arg
elif opt in ('-d', '--plugins'):
plugins = arg
else:
assert False, "unhandled option"
if not (jid and password):
usage(sys.argv[0])
sys.exit(2)
plugins = os.path.abspath(plugins)
bot = jabber_bot.client.JabberBot(jid, password, plugins)
bot.loop()
Something went wrong with that request. Please try again.