# HG changeset patch # User Ludovic Chabant # Date 1413090401 25200 # Node ID 8ea76932ea3a359c91e22874f5e4ea4e9632dbe4 # Parent 566d229d1b305961e8d5ae2c36c77b9c00f531f2 More proper shutdown, and more proper use of the parameter context. diff -r 566d229d1b30 -r 8ea76932ea3a wikked/wiki.py --- a/wikked/wiki.py Sat Oct 11 22:05:48 2014 -0700 +++ b/wikked/wiki.py Sat Oct 11 22:06:41 2014 -0700 @@ -143,7 +143,7 @@ # Default to Mercurial. Yes. I just decided that myself. scm_type = 'hg' - if self.context != NORMAL_CONTEXT and scm_type == 'hg': + if self.context == INIT_CONTEXT and scm_type == 'hg': # Quick workaround for when we're creating a new repo, # or running background tasks. # We'll be using the `hg` process instead of the command @@ -237,10 +237,10 @@ for o in order: o.postInit() - def stop(self): + def stop(self, exception=None): """ De-initializes the wiki and its sub-systems. """ - self.db.close() + self.db.close(exception) def reset(self): """ Clears all the cached data and rebuilds it from scratch.