cms.management.commands.subcommands.list: 21 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/management/commands/subcommands/list.py

Stats: 0 executed, 17 missed, 4 excluded, 8 ignored

  1. # -*- coding: utf-8 -*-
  2. from cms.management.commands.subcommands.base import SubcommandsCommand
  3. from cms.models.pluginmodel import CMSPlugin
  4. from cms.models.titlemodels import Title
  5. from django.core.management.base import NoArgsCommand
  6. class ListApphooksCommand(NoArgsCommand):
  7. help = 'Lists all apphooks in pages'
  8. def handle_noargs(self, **options):
  9. urls = Title.objects.filter(application_urls__gt='').values_list("application_urls", flat=True)
  10. for url in urls:
  11. self.stdout.write('%s\n' % url)
  12. class ListPluginsCommand(NoArgsCommand):
  13. help = 'Lists all plugins in CMSPlugin'
  14. def handle_noargs(self, **options):
  15. plugins = CMSPlugin.objects.distinct().values_list("plugin_type", flat=True)
  16. for plugin in plugins:
  17. self.stdout.write(plugin+'\n')
  18. class ListCommand(SubcommandsCommand):
  19. help = 'List commands'
  20. subcommands = {
  21. 'apphooks': ListApphooksCommand,
  22. 'plugins': ListPluginsCommand
  23. }