~ubuntu-branches/ubuntu/trusty/horizon/trusty-updates

« back to all changes in this revision

Viewing changes to horizon/test/customization/cust_test1.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-09-06 11:59:43 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20130906115943-h3td0l7tp16mb9oc
Tags: 1:2013.2~b3-0ubuntu1
* New upstream release.
* debian/control: Minimum python-openstack-auth version >= 1.1.1.
* debian/control: Add python-troveclient.
* debian/static: Refresh static assets for 2013.2~b3.
* debian/patches: ubuntu_local_settings.patch -> ubuntu_settings.patch, also
  patch location of secret key in openstack_dashboard/settings.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django.utils.translation import ugettext_lazy as _
 
1
from django.utils.translation import ugettext_lazy as _  # noqa
2
2
 
3
3
import horizon
4
 
 
5
 
# Rename "cats" to "wildcats"
6
 
cats = horizon.get_dashboard("cats")
7
 
cats.name = _("WildCats")
8
 
 
9
 
# Disable tigers panel
10
 
tigers = cats.get_panel("tigers")
11
 
cats.unregister(tigers.__class__)
12
 
 
13
 
# Remove dogs dashboard
14
 
dogs = horizon.get_dashboard("dogs")
15
 
horizon.unregister(dogs.__class__)
 
4
from horizon import base
 
5
 
 
6
# Rename "cats" to "wildcats", ignore if panel doesn't exist
 
7
try:
 
8
    cats = horizon.get_dashboard("cats")
 
9
    cats.name = _("WildCats")
 
10
except base.NotRegistered:
 
11
    cats = None
 
12
 
 
13
# Disable tigers panel, ignore if panel doesn't exist
 
14
if cats:
 
15
    try:
 
16
        tigers = cats.get_panel("tigers")
 
17
        cats.unregister(tigers.__class__)
 
18
    except base.NotRegistered:
 
19
        pass
 
20
 
 
21
# Remove dogs dashboard, ignore if dashboard doesn't exist
 
22
try:
 
23
    dogs = horizon.get_dashboard("dogs")
 
24
    horizon.unregister(dogs.__class__)
 
25
except base.NotRegistered:
 
26
    pass