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

« back to all changes in this revision

Viewing changes to horizon/__init__.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-09 11:50:22 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120309115022-ymiww5i58rbg97my
Tags: 2012.1~rc1~20120308.1479-0ubuntu1
* New upstream version.
* debian/rules: Fix symlink when installing horizon.
  (LP: #947118)
* debian/control: Add python-django-nose as a dep. (LP: #944235)
* debian/control: Fix broken depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
# Because this module is compiled by setup.py before Django may be installed
25
25
# in the environment we try importing Django and issue a warning but move on
26
26
# should that fail.
27
 
django = None
 
27
Horizon = None
28
28
try:
29
 
    import django
 
29
    from horizon.base import Horizon, Dashboard, Panel, Workflow
30
30
except ImportError:
31
31
    import warnings
32
32
 
33
33
    def simple_warn(message, category, filename, lineno, file=None, line=None):
34
34
        return '%s: %s' % (category.__name__, message)
35
35
 
36
 
    msg = ("Could not import Django. This is normal during installation.\n")
 
36
    msg = ("Could not import Horizon dependencies. "
 
37
           "This is normal during installation.\n")
37
38
    warnings.formatwarning = simple_warn
38
39
    warnings.warn(msg, Warning)
39
40
 
40
 
if django:
 
41
if Horizon:
41
42
    # This can be removed once the upstream bug is fixed.
 
43
    import django
42
44
    if django.VERSION < (1, 4):
43
45
        from horizon.utils import reverse_bugfix
44
46
 
45
 
    from horizon.base import Horizon, Dashboard, Panel, Workflow
46
 
 
47
47
    register = Horizon.register
48
48
    unregister = Horizon.unregister
49
49
    get_absolute_url = Horizon.get_absolute_url