Exemplo n.º 1
0
    def main(self, *args, **kwds):
        debugOn = debug("debug_on")
        debugOn.activate()
        debugOn.log("This journal should be on.")
        debugOn.deactivate()
        debugOn.log("This journal should be off.")

        debugOff = debug("debug_off")
        debugOff.log("This journal should be off.")
Exemplo n.º 2
0
    def __init__(self, name=None):
        Traceable.__init__(self)

        if name is None:
            name = self.name  # class attribute
        else:
            self.name = name
        self.inventory = self.createInventory()

        # provide simple, convenient access to descriptors
        self.metainventory = self.createMetaInventory()

        # other names by which I am known for configuration purposes
        self.aliases = [name]

        from pythia.journal.diagnostics import (debug, info, error, warning)
        self._debug = debug(name)
        self._info = info(name)
        self._error = error(name)
        self._warning = warning(name)

        # modify the inventory defaults that were hardwired at compile time
        # gives derived components an opportunity to modify their default behavior
        # from what was inherited from their parent's inventory
        self._defaults()

        return
Exemplo n.º 3
0
    def __init__(self, name):
        self._name = name
        self._options = None

        from pythia.journal.diagnostics import debug
        self._debug = debug(name)

        return
Exemplo n.º 4
0
    def __init__(self, name):
        self.codecs = {}

        tag = name + '.curator'

        from pythia.journal.diagnostics import (info, debug)
        self._info = info(tag)
        self._debug = debug(tag)

        return
Exemplo n.º 5
0
    def __init__(self):
        self.actions = {
            'complete': ['c'],
        }
        self.aliases = {
            'help': ['?', 'h'],
        }
        self.assignment = '='
        self.prefixes = ['--', '-']
        self.separator = '.'

        self.action = None
        self.argv = []
        self.processed = []
        self.unprocessed = []

        import pythia.pyre.parsing.locators
        self.locator = pythia.pyre.parsing.locators.commandLine()

        from pythia.journal.diagnostics import debug
        self._debug = debug("pyre.commandline")

        return
Exemplo n.º 6
0
 def setUp(self):
     self.journal = diagnostics.debug("test")
     self.journal.activate()
Exemplo n.º 7
0
 def test_debug(self):
     debug = diagnostics.debug("test")
     self._check_journal("debug.log", "debug", debug)