def cmd_index(self, output=None): '''Method called when doing a commandline index re-build''' if not output is None: import zim.index index = zim.index.Index(self.notebook, output) else: index = self.notebook.index index.flush() def on_callback(path): logger.info('Indexed %s', path.name) return True index.update(callback=on_callback)
def cmd_index(self, output=None): """Convenience method for the commandline 'index' command @keyword output: the index file to update, defaults to the default index s used by the notebook """ if not output is None: import zim.index index = zim.index.Index(self.notebook, output) else: index = self.notebook.index index.flush() def on_callback(path): logger.info("Indexed %s", path.name) return True index.update(callback=on_callback)