X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?p=irc.git;a=blobdiff_plain;f=acrobat.py;h=0d9202ea8f46b430cc2de8cfb0199b55ec58e4fd;hp=6bed11a18dcc70e92640353b39c77c269d748d4d;hb=b5a57c9c7f3d072c21dfbab9fd0fdc4d906388c5;hpb=9a8c6f919c6e2df251c611630a1d4bdfb4205548 diff --git a/acrobat.py b/acrobat.py index 6bed11a..0d9202e 100755 --- a/acrobat.py +++ b/acrobat.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # Bot logic: # Andrew Walkingshaw @@ -78,7 +78,7 @@ class Acrobat(SingleServerIRCBot): self.connection.notice(nick, msg) def main(): - if len(sys.argv)!=2: + if len(sys.argv) < 2: print "acrobat: provide configuration module name on command line" sys.exit(1) try: @@ -86,6 +86,10 @@ def main(): except ImportError: print "acrobat: configuration module "+sys.argv[1]+".py not found" sys.exit(1) + # Override configuration items from the rest of the command line + for opt in sys.argv[2:]: + (key,value)=opt.split("=") + c.__dict__[key] = value bot = Acrobat(c) bot.start()