From 3e0ab193b37228fc1856d31806088248baa90818 Mon Sep 17 00:00:00 2001 From: Richard Kettlewell Date: Thu, 29 Oct 2009 21:33:40 +0000 Subject: [PATCH] Allow command line override to acrobat config --- acrobat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acrobat.py b/acrobat.py index 6bed11a..f500593 100755 --- a/acrobat.py +++ b/acrobat.py @@ -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() -- 2.30.2