All pastes #974798 Raw Edit

Miscellany

public python v1 · immutable
·published 2008-04-07 01:52 UTC
rendered paste body
class Site(object):    def __new__(cls, *args, **kwds):        if kwds["path"]:            try:                class_ = __import__("pages." + kwds["path"], fromlist=[kwds["path"]).Page            except ImportError:                class_ = __import__("pages.notfound", fromlist=["notfound"]).Page        else:            class_ = __import__("pages.index", fromlist=["index"]).Page        return class_()