コード例 #1
0
def tiddler_put_hook(store, tiddler):
    """
    Update the links database with data from this tiddler.
    """
    links_manager = LinksManager(store.environ)
    links_manager.delete_links(tiddler)
    if _is_parseable(tiddler):
        links_manager.update_database(tiddler)
コード例 #2
0
def tiddler_change_hook(store, tiddler):
    """
    Update the links database with data from this tiddler.

    TODO: work with other renderable types, not just tiddlywiki text.
    """
    links_manager = LinksManager(store.environ)
    links_manager.delete_links(tiddler)
    if not tiddler.type or tiddler.type == 'None':
        links_manager.update_database(tiddler)
コード例 #3
0
    def refreshlinksdb(args):
        """Refresh the back and front links database."""
        store = get_store(config)

        links_manager = LinksManager(store.environ)
        for bag in store.list_bags():
            LOGGER.debug('updating links for tiddlers in bag: %s', bag.name)
            for tiddler in store.list_bag_tiddlers(bag):
                tiddler = store.get(tiddler)  # we must get text
                links_manager.delete_links(tiddler)
                if _is_parseable(tiddler):
                    links_manager.update_database(tiddler)