diff start_bots_from_xml_config.py @ 13:a9077fa9cac9

Added optional parameter to start_bots_from_xml_config.py Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Mon, 17 Aug 2009 13:19:37 +0200
parents 4c842d23d4ce
children 32a35f7eff70
line wrap: on
line diff
--- a/start_bots_from_xml_config.py
+++ b/start_bots_from_xml_config.py
@@ -20,14 +20,18 @@
 from bot import bot
 from time import sleep
 from xml.dom.minidom import parse
+import sys
 
 
 bots = []
 
 try:
-	config = parse('config.xml')
+	if len(sys.argv) > 1:
+		config = parse(sys.argv[1])
+	else:
+		config = parse('config.xml')
 except IOError:
-	print 'Error: config.xml is missing or cannot be read'
+	print 'Error: configuration file is missing or cannot be read'
 	quit(1)
 
 bots_jids = []