muyhomepage2 / muyhomepage2 / pagehandlers /

from muyhomepage2 import util

class PageHandler(object):
    def __init__(self, page): = page

    def content(self):
        raise NotImplementedError('PageHandler.content')

    def tags(self):
        return sorted(

    def createdon(self):

    def modifiedon(self):

    def finalname(self):
        if 'x-force-file-name' in
        return '%s.html' % util.encodetitle(

    def template(self):
        return None

    def extension(self, website, config):
        raise NotImplementedError('PageHandler.extension')

def handle_action(registry, default, page):
    """ Return a PageHandler object based on the given ``page``'s action
    header. If the action header is not present construct a handler
    based on the ``default``. The value of the action header must map
    to a key in the ``registry`` otherwise.
    if 'action' not in page.headers:
        handler = default
        handler = registry[page.headers['action']]
    return handler(page)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.