/usr/share/pyshared/fusil/mockup.py is in fusil 1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | """
Classes mockup used for unit tests.
"""
from weakref import ref
class Logger:
def __init__(self, show=False):
self.show = show
def debug(self, message, sender=None):
self.display(message)
def info(self, message, sender=None):
self.display(message)
def warning(self, message, sender=None):
self.display(message)
def error(self, message, sender=None):
self.display(message)
def display(self, message):
if not self.show:
return
print message
class MTA:
def __init__(self, logger=None):
if not logger:
logger = Logger()
self.logger = logger
def registerMailingList(self, mailbox, event):
pass
def deliver(self, message):
pass
class Options:
def __init__(self):
self.debug = False
class Application:
def __init__(self):
self.options = Options()
def initX11(self):
pass
class Config:
def __getattr__(self, name):
return None
class Debugger:
def tracePID(self, agent, pid):
pass
class Project:
def __init__(self, logger=None):
self._mta = MTA(logger)
self.mta = ref(self._mta)
self._application = Application()
self.application = ref(self._application)
self.debugger = Debugger()
self.config = Config()
def registerAgent(self, agent):
pass
def unregisterAgent(self, agent):
pass
|