Example #1
0
    def compare_tags_and_feeds(self, shelf):
        for tag in alltags.get_tags():
            for item in alltags.tags[tag]:
                URL = dict_id(item)["URL"]
                id = dict_id(item)["ID"]

                feed = allfeeds.get_feed(dict_id(item)["URL"])
                if tag.startswith("maintag:") and tag[8:] == feed.name:
                    continue

                for entry in shelf[feed.URL]["entries"]:
                    if id == entry["id"] and tag not in entry["canto-tags"]:
                        raise Exception("Tag %s has no source: %s / %s!" % (tag, feed.name, entry))
Example #2
0
    def compare_tags_and_feeds(self, shelf):
        for tag in alltags.get_tags():
            for item in alltags.tags[tag]:
                URL = dict_id(item)["URL"]
                id = dict_id(item)["ID"]

                feed = allfeeds.get_feed(dict_id(item)["URL"])
                if tag.startswith("maintag:") and tag[8:] == feed.name:
                    continue

                for entry in shelf[feed.URL]["entries"]:
                    if id == entry["id"] and tag not in entry["canto-tags"]:
                        raise Exception("Tag %s has no source: %s / %s!" %
                                        (tag, feed.name, entry))
Example #3
0
def post_setattributes(socket, args):
    for item_id in args.keys():
        dict_id = json.loads(item_id)

        feed = allfeeds.get_feed(dict_id["URL"])

        attrs = feed.get_attributes([item_id], { item_id :\
                ["canto_inoreader_id", "canto_inoreader_categories", "canto-state", "canto-tags"] })
        attrs = attrs[item_id]

        # If the canto_inoreader_id isn't right (likely empty since get_attributes
        # will sub in "") then skip synchronizing this item.

        ino_id = attrs["canto_inoreader_id"]
        if not ino_id.startswith("tag:google.com,2005:reader/item/"):
            continue

        sync_state_to(args[item_id], attrs)

    api.flush_changes()
Example #4
0
def post_setattributes(socket, args):
    for item_id in args.keys():
        dict_id = json.loads(item_id)

        feed = allfeeds.get_feed(dict_id["URL"])

        attrs = feed.get_attributes([item_id], { item_id :\
                ["canto_inoreader_id", "canto_inoreader_categories", "canto-state", "canto-tags"] })
        attrs = attrs[item_id]

        # If the canto_inoreader_id isn't right (likely empty since get_attributes
        # will sub in "") then skip synchronizing this item.

        ino_id = attrs["canto_inoreader_id"]
        if not ino_id.startswith("tag:google.com,2005:reader/item/"):
            continue

        sync_state_to(args[item_id], attrs)

    api.flush_changes()