def _reload(): ircdb.users.reload() ircdb.ignores.reload() ircdb.channels.reload() registry.open(world.registryFilename)
def testBackslashes(self): conf.supybot.reply.whenAddressedBy.chars.set('\\') filename = conf.supybot.directories.conf.dirize('backslashes.conf') registry.close(conf.supybot, filename) registry.open(filename) self.assertEqual(conf.supybot.reply.whenAddressedBy.chars(), '\\')
sys.stderr.write('Dude, don\'t even try to run this as root.\n') sys.exit(-1) if len(args) > 1: parser.error("""Only one configuration option should be specified.""") elif not args: parser.error( utils.str.normalizeWhitespace("""It seems you've given me no configuration file. If you have a configuration file, be sure to tell its filename. If you don't have a configuration file, read docs/GETTING_STARTED and follow its directions.""")) else: registryFilename = args.pop() try: # The registry *MUST* be opened before importing log or conf. registry.open(registryFilename) shutil.copy(registryFilename, registryFilename + '.bak') except registry.InvalidRegistryFile, e: s = '%s in %s. Please fix this error and start supybot again.' % \ (e, registryFilename) s = textwrap.fill(s) sys.stderr.write(s) sys.stderr.write(os.linesep) raise sys.exit(-1) except EnvironmentError, e: sys.stderr.write(str(e)) sys.stderr.write(os.linesep) sys.exit(-1) try: