This commit is contained in:
Jeremy Fincher 2004-02-07 12:25:56 +00:00
parent 94c16a0bd3
commit 169a69255a

View File

@ -38,12 +38,13 @@ import os
import sys import sys
import optparse import optparse
import registry
def main(): def main():
from conf import version import log
import conf
conf.supybot.log.stdout.setValue(False)
parser = optparse.OptionParser(usage='Usage: %prog [options] <configFile>', parser = optparse.OptionParser(usage='Usage: %prog [options] <configFile>',
version='supybot %s' % version) version='supybot %s' % conf.version)
parser.add_option('-u', '--username', action='store', default='', parser.add_option('-u', '--username', action='store', default='',
dest='name', dest='name',
help='username for the user.') help='username for the user.')
@ -64,14 +65,10 @@ def main():
if len(args) is not 1: if len(args) is not 1:
parser.error('specify the configuration file you\'d like to use.') parser.error('specify the configuration file you\'d like to use.')
registry.open(args[0]) conf.supybot.directories.conf.setValue('.')
import conf conf.supybot.databases.users.filename.setValue(args[0])
import log
import ircdb import ircdb
oldLogLevel = conf.supybot.log.level()
conf.supybot.log.level.set('CRITICAL')
if not options.name: if not options.name:
name = '' name = ''
while not name: while not name:
@ -124,8 +121,6 @@ def main():
user.addCapability(capability) user.addCapability(capability)
ircdb.users.setUser(id, user) ircdb.users.setUser(id, user)
print 'User %s added.' % name print 'User %s added.' % name
conf.supybot.log.level.setValue(oldLogLevel)
registry.close(conf.supybot, args[0])
if __name__ == '__main__': if __name__ == '__main__':
try: try: