All pastes #1353060 Raw Edit

Stuff

public python v1 · immutable
#1353060 ·published 2009-03-04 23:13 UTC
rendered paste body
# 1. Adding a default title to the terminal canto starts in, "Canto" in# this case    def start_hook(gui):        import os        os.write(1, u"\033]0; Canto\007")# 2. Case insensitive only_with filter (this will be a keyword in future# version of Canto)    class insensitive_only_with(only_with):        def __call__(self, tag, item):            return self.match.match(item["title"].lower())# 3. Adding the feed name to the reader (UTF-8 encoding):    class reader_with_tag(renderer):        def reader_head(self, dict):            title = self.do_regex(dict["story"]["title"], self.story_rgx)            return [(u"%1%B" + dict["story"].feed.tags[0] + " : "\                    + title, u" ", u" "), (u"%1┌",u"─",u"┐%C")]    default_renderer(reader_with_tag())# 4. Making the list of links visible in the reader by default    keys[' '] = ["reader","toggle_show_links"]# 5. Keybind to move to the next item while in the reader, without# marking the current one as read    reader_keys['n'] = ["destroy","just_unread","next_item","reader"]