make the config file argument optional.
this should probably be robustified (--config-file=foo) eventually
This commit is contained in:
		
							parent
							
								
									00d5502477
								
							
						
					
					
						commit
						b487caf12d
					
				| @ -69,14 +69,15 @@ class DrBotIRC(irclib.IRC): | ||||
|          self.connections.append(c) | ||||
|          return c | ||||
| 
 | ||||
| config_file = 'dr.botzo.cfg' | ||||
| # check argv | ||||
| if len(sys.argv) != 2: | ||||
|     sys.exit("Needs one argument, the config filename") | ||||
| if len(sys.argv) == 2: | ||||
|     config_file = sys.argv[1] | ||||
| 
 | ||||
| # read config file | ||||
| 
 | ||||
| config = ConfigParser({'debug': 'false'}) | ||||
| config.read(os.path.expanduser(sys.argv[1])) | ||||
| config.read(os.path.expanduser(config_file)) | ||||
| 
 | ||||
| # load necessary options | ||||
| try: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user