import dbus
import sys
try:
    import locals
except ImportError:
    sys.exit("Error: configuration is missing. "
             "Use locals.py.in as basics and create locals.py")

class Printer():

    def __init__(self):
        self.prefix = ''
        self.silence = False

    def __call__(self, text):
        if not self.silence:
            print(self.prefix + text)

    def tab(self, space=' '):
        self.prefix = self.prefix + 4 * space

    def untab(self):
        self.prefix = self.prefix[:-4]

    def silence(self):
        self.silence = True

    def talk(self):
        self.silence = False

    def debug(self, msg):
        if locals.DEBUG:
            print('[DEBUG]: ' + msg)


def notify(body, headline='Labtool Ready!', app_name='LabTool', app_icon='',
        timeout=50000, actions=[], hints=[], replaces_id=0):
    try:
        _bus_name = 'org.freedesktop.Notifications'
        _object_path = '/org/freedesktop/Notifications'
        _interface_name = _bus_name

        session_bus = dbus.SessionBus()
        obj = session_bus.get_object(_bus_name, _object_path)
        interface = dbus.Interface(obj, _interface_name)
        interface.Notify(app_name, replaces_id, app_icon,
                headline, body, actions, hints, timeout)
    except Exception:
        print body


def monitor(hostname, domain):
    try:
        bus_name = 'org.kde.konsole'
        object_path = '/Konsole'
        interface_name = 'org.kde.konsole.Window'

        session_bus = dbus.SessionBus()
        obj = session_bus.get_object(bus_name, object_path)
        interface = dbus.Interface(obj, interface_name)

        session = interface.newSession()

        object_path = '/Sessions/%s' % session
        interface_name = 'org.kde.konsole.Session'

        session_bus = dbus.SessionBus()
        obj = session_bus.get_object(bus_name, object_path)
        interface = dbus.Interface(obj, interface_name)

        logfile = getattr(locals, 'LOG_FILE', None) or '/vmlog'
        user = getattr(locals, 'USER', None)

        interface.sendText("ssh -n %s@%s.%s 'sudo tail -f %s'" %
                           (user, hostname, domain, logfile))
        interface.sendText("\n")
    except:
        pass

show = Printer()

@@ -243,37 +243,8 @@
 = ''
-%0A        self.silence = False
 %0A%0A  
@@ -275,41 +275,8 @@
 t):%0A
-        if not self.silence:%0A    
     
@@ -305,16 +305,16 @@
 + text)%0A
+
 %0A    def
@@ -396,32 +396,32 @@
 ef untab(self):%0A
+
         self.pre
@@ -448,110 +448,8 @@
 4%5D%0A%0A
-    def silence(self):%0A        self.silence = True%0A%0A    def talk(self):%0A        self.silence = False%0A%0A
     

remove non-functional and unused code from printer.py