~ubuntu-branches/ubuntu/precise/landscape-client/precise

« back to all changes in this revision

Viewing changes to landscape/package/interface.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2012-03-19 09:33:34 UTC
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: package-import@ubuntu.com-20120319093334-oxjttz163vvfgq8s
Tags: upstream-12.04
ImportĀ upstreamĀ versionĀ 12.04

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import types
3
3
import sys
4
4
 
5
 
from smart.interface import Interface
6
 
from smart.const import ERROR, WARNING, INFO, DEBUG
7
 
 
8
 
import smart.interfaces
 
5
try:
 
6
    import smart.interfaces
 
7
    from smart.interface import Interface
 
8
    from smart.const import ERROR, WARNING, INFO, DEBUG
 
9
except ImportError:
 
10
    # Smart is optional if AptFacade is being used.
 
11
    Interface = object
9
12
 
10
13
 
11
14
class LandscapeInterface(Interface):
61
64
        self.__output += output
62
65
 
63
66
 
64
 
 
65
 
 
66
67
class LandscapeInterfaceModule(types.ModuleType):
67
68
 
68
69
    def __init__(self):
78
79
        smart.interfaces.landscape = LandscapeInterfaceModule()
79
80
        sys.modules["smart.interfaces.landscape"] = smart.interfaces.landscape
80
81
 
 
82
 
81
83
def uninstall_landscape_interface():
82
84
    sys.modules.pop("smart.interfaces.landscape", None)