mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made a stronger attempt to make sure the registry file gets written.
This commit is contained in:
parent
5b120d3276
commit
b18ad358ee
@ -64,17 +64,14 @@ def main():
|
|||||||
schedule.addPeriodicEvent(world.upkeep, 300)
|
schedule.addPeriodicEvent(world.upkeep, 300)
|
||||||
world.startedAt = started
|
world.startedAt = started
|
||||||
try:
|
try:
|
||||||
try:
|
while world.ircs:
|
||||||
while world.ircs:
|
drivers.run()
|
||||||
drivers.run()
|
log.info('No more Irc objects, exiting.')
|
||||||
log.info('No more Irc objects, exiting.')
|
except KeyboardInterrupt:
|
||||||
except KeyboardInterrupt:
|
log.info('Exiting due to Ctrl-C.')
|
||||||
log.info('Exiting due to Ctrl-C.')
|
raise SystemExit, 'Goodbye!'
|
||||||
raise SystemExit, 'Goodbye!'
|
except:
|
||||||
except:
|
log.exception('Exception raised out of drivers.run:')
|
||||||
log.exception('Exception raised out of drivers.run:')
|
|
||||||
finally:
|
|
||||||
registry.close(conf.supybot, args[0])
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
###
|
###
|
||||||
@ -114,8 +111,9 @@ if __name__ == '__main__':
|
|||||||
if not args or len(args) > 1:
|
if not args or len(args) > 1:
|
||||||
parser.error()
|
parser.error()
|
||||||
|
|
||||||
|
registryFilename = args.pop()
|
||||||
try:
|
try:
|
||||||
registry.open(args[0])
|
registry.open(registryFilename)
|
||||||
except registry.InvalidRegistryFile, e:
|
except registry.InvalidRegistryFile, e:
|
||||||
sys.stderr.write(str(e))
|
sys.stderr.write(str(e))
|
||||||
sys.stderr.write('\n')
|
sys.stderr.write('\n')
|
||||||
@ -124,6 +122,12 @@ if __name__ == '__main__':
|
|||||||
import log
|
import log
|
||||||
import conf
|
import conf
|
||||||
|
|
||||||
|
def closeRegistry():
|
||||||
|
log.info('Writing registry file to %s', registryFilename)
|
||||||
|
registry.close(conf.supybot, registryFilename)
|
||||||
|
log.info('Finished writing registry file.')
|
||||||
|
atexit.register(closeRegistry)
|
||||||
|
|
||||||
nick = options.nick or conf.supybot.nick.get()
|
nick = options.nick or conf.supybot.nick.get()
|
||||||
user = options.user or conf.supybot.user.get()
|
user = options.user or conf.supybot.user.get()
|
||||||
ident = options.ident or conf.supybot.ident.get()
|
ident = options.ident or conf.supybot.ident.get()
|
||||||
|
Loading…
Reference in New Issue
Block a user