Example #1
0
    def eval(self):
        story = self.story
        s = ""

        if "read" in story.content["canto-state"]:
            s += cc("read")
        else:
            s += cc("unread")

        if story.marked:
            s += cc("marked") + "[*]"

        if story.selected:
            s += cc("selected")

        s += prep_for_display(story.content["title"])

        if story.selected:
            s += cc.end("selected")

        if story.marked:
            s += cc.end("marked")

        if "read" in story.content["canto-state"]:
            s += cc.end("read")
        else:
            s += cc.end("unread")

        return s
Example #2
0
    def eval(self):
        story = self.story
        s = ""

        if "read" in story.content["canto-state"]:
            s += cc("read")
        else:
            s += cc("unread")

        if story.marked:
            s += cc("marked") + "[*]"

        if story.selected:
            s += cc("selected")

        s += prep_for_display(story.content["title"])

        if story.selected:
            s += cc.end("selected")

        if story.marked:
            s += cc.end("marked")

        if "read" in story.content["canto-state"]:
            s += cc.end("read")
        else:
            s += cc.end("unread")

        return s
Example #3
0
    def edit_debug(self, body, extra_content):
        sel = self.reader.callbacks["get_var"]("reader_item")
        if not sel:
            return

        if not self.got_attrs:
            on_hook("curses_attributes", self.on_attributes)
            tag_updater.request_attributes(sel.id, [])
        else:
            extra_content += '\n\n'
            for k in sel.content.keys():
                line = '[%s]: %s' % (k, sel.content[k])
                extra_content += prep_for_display(line) + '\n'

        return(body, extra_content)
Example #4
0
    def edit_debug(self, body, extra_content):
        sel = self.reader.callbacks["get_var"]("reader_item")
        if not sel:
            return

        if not self.got_attrs:
            on_hook("curses_attributes", self.on_attributes)
            tag_updater.request_attributes(sel.id, [])
        else:
            extra_content += '\n\n'
            for k in sel.content.keys():
                line = '[%s]: %s' % (k, sel.content[k])
                extra_content += prep_for_display(line) + '\n'

        return (body, extra_content)