sekizai.data: 16 total statements, 0.0% covered

Generated: Wed 2013-03-13 10:33 CET

Source file: /media/Envs/Envs/filer-gallery/lib/python2.7/site-packages/sekizai/data.py

Stats: 0 executed, 16 missed, 0 excluded, 17 ignored

  1. class SekizaiList(list):
  2. """
  3. A sekizai namespace in a template.
  4. """
  5. def __init__(self, namespace):
  6. self._namespace = namespace
  7. super(SekizaiList, self).__init__()
  8. def append(self, obj):
  9. """
  10. When content gets added, run the filters for this namespace.
  11. """
  12. if obj not in self:
  13. super(SekizaiList, self).append(obj)
  14. def render(self, between='\n'):
  15. """
  16. When the data get's rendered, run the postprocess filters.
  17. """
  18. return between.join(self)
  19. class SekizaiDictionary(dict):
  20. """
  21. A dictionary which auto fills itself instead of raising key errors.
  22. """
  23. def __init__(self):
  24. super(SekizaiDictionary, self).__init__()
  25. def __getitem__(self, item):
  26. if item not in self:
  27. self[item] = SekizaiList(item)
  28. return super(SekizaiDictionary, self).__getitem__(item)