cms.conf: 20 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/cms/conf/__init__.py

Stats: 0 executed, 16 missed, 4 excluded, 20 ignored

  1. # -*- coding: utf-8 -*-
  2. from django.conf import settings
  3. from patch import pre_patch, post_patch, post_patch_check
  4. import warnings
  5. def patch_settings():
  6. """Merge settings with global cms settings, so all required attributes
  7. will exist. Never override, just append non existing settings.
  8. Also check for setting inconstistence if settings.DEBUG
  9. """
  10. if patch_settings.ALREADY_PATCHED:
  11. return
  12. patch_settings.ALREADY_PATCHED = True
  13. if getattr(settings, 'CMS_FLAT_URLS', False):
  14. warnings.warn("CMS_FLAT_URLS are deprecated and will be removed in django CMS 2.4!", DeprecationWarning)
  15. if getattr(settings, 'CMS_MODERATOR', False):
  16. warnings.warn("CMS_MODERATOR will be removed and replaced in django CMS 2.4!", DeprecationWarning)
  17. from cms.conf import global_settings
  18. # patch settings
  19. pre_patch()
  20. # merge with global cms settings
  21. for attr in dir(global_settings):
  22. if attr == attr.upper() and not hasattr(settings, attr):
  23. setattr(settings._wrapped, attr, getattr(global_settings, attr))
  24. post_patch()
  25. if settings.DEBUG:
  26. # check if settings are correct, call this only if debugging is enabled
  27. post_patch_check()
  28. patch_settings.ALREADY_PATCHED = False