示例#1
0
	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)
示例#2
0
文件: __init__.py 项目: Jam71/Zim-QDA
    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)