mercurial/demandload.py
author kreijack@inwind.REMOVEME.it
Sun, 10 Jul 2005 15:59:26 -0800
changeset 661 148f642d1f8e
parent 262 3db700146536
child 1826 f3abe0bdccdd
permissions -rw-r--r--
Add rss tag in the changelog/filelog html template. # HG changeset patch # User kreijack@inwind.REMOVEME.it # Node ID 20edcc82038fce8460076ca5723fbbb919016356 # Parent 8c89408a7154d2da94766e957a088407fd0fef93 Add rss tag in the changelog/filelog html template. This patch add rss tags in the changelog/filelog template html pages. This tags permit the browser to detect the rss feed.

def demandload(scope, modules):
    class d:
        def __getattr__(self, name):
            mod = self.__dict__["mod"]
            scope = self.__dict__["scope"]
            scope[mod] = __import__(mod, scope, scope, [])
            return getattr(scope[mod], name)

    for m in modules.split():
        dl = d()
        dl.mod = m
        dl.scope = scope
        scope[m] = dl