# Path: lib/registry.py
# class Registry(dict):
#     def set(self, key, value):
#         self[key] = value
#     def get(self, key):
#         if self.has_key(key):
#             return self[key]
#         else:
#             return False


import os
import genshi
from google.appengine.ext.webapp import template
from lib.registry import Registry
from genshi.template import TemplateLoader
from genshi import Markup
    def __init__(self, template_name=False, name=False):
      self.template_name = template_name
      self.name = name

    def render(self):
        html = ''
        if self.blocks:
            for block in self.blocks.values():
                html += block.render()
        else:
            html = {
                'genshi': render_template,
                'django': render_django_template
            }[self.template_engine](self.template_file, self.template_vals)
        return html
  
class Layout(object):
    blocks = {}
    root = Block('layout', 'root')
    def render(self):
        return self.root.render()
	
    @classmethod
    def addBlock(cls,template_file=None,name=None, BlockObj=None):
        if BlockObj:
          block = BlockObj()
        else:
          block = Block()
        if name:
            block.name = name

# Path: lib/registry.py
# class Registry(dict):
#     def set(self, key, value):
#         self[key] = value
#     def get(self, key):
#         if self.has_key(key):
#             return self[key]
#         else:
#             return False


# Path: blocks.py
import os
import genshi
from google.appengine.ext.webapp import template
from lib.registry import Registry
from genshi.template import TemplateLoader
from genshi import Markup

    def __init__(self, template_name=False, name=False):
      self.template_name = template_name
      self.name = name

    def render(self):
        html = ''
        if self.blocks:
            for block in self.blocks.values():
                html += block.render()
        else:
            html = {
                'genshi': render_template,
                'django': render_django_template
            }[self.template_engine](self.template_file, self.template_vals)
        return html
  
class Layout(object):
    blocks = {}
    root = Block('layout', 'root')
    def render(self):
        return self.root.render()
	
    @classmethod
    def addBlock(cls,template_file=None,name=None, BlockObj=None):
        if BlockObj:
          block = BlockObj()
        else:
          block = Block()
        if name:
            block.name = name

        else: