mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-31 23:57:22 +01:00 
			
		
		
		
	Added filename option for specifying what users.conf file to use.
This commit is contained in:
		
							parent
							
								
									76febf41ec
								
							
						
					
					
						commit
						6fdde226c7
					
				| @ -34,12 +34,12 @@ import supybot | ||||
| from fix import * | ||||
| from questions import * | ||||
| 
 | ||||
| import os | ||||
| import sys | ||||
| import optparse | ||||
| 
 | ||||
| import conf | ||||
| import debug | ||||
| import ircdb | ||||
| 
 | ||||
| debug.minimumPriority = 'high' | ||||
| 
 | ||||
| @ -56,6 +56,11 @@ def main(): | ||||
|                       dest='capabilities', metavar='CAPABILITY', | ||||
|                       help='capability the user should have; ' | ||||
|                            'this option may be given multiple times.') | ||||
|     filename = os.path.join(conf.confDir, conf.userfile) | ||||
|     parser.add_option('-f', '--filename', action='store', default=filename, | ||||
|                       dest='filename', | ||||
|                       help='filename of your users.conf; ' | ||||
|                            'defaults to %s' % filename) | ||||
| 
 | ||||
|     (options, args) = parser.parse_args() | ||||
|     if not options.name: | ||||
| @ -77,6 +82,10 @@ def main(): | ||||
|     else: | ||||
|         capabilities = options.capabilities | ||||
| 
 | ||||
|     conf.confDir = os.path.dirname(options.filename) | ||||
|     conf.userfile = os.path.basename(options.filename) | ||||
|     import ircdb | ||||
| 
 | ||||
|     try: | ||||
|         # First, let's check to see if the user is already in the database. | ||||
|         _ = ircdb.users.getUser(name) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jeremy Fincher
						Jeremy Fincher