コード例 #1
0
ファイル: lmibase.py プロジェクト: jsafrane/openlmi-doc
 def setUpClass(cls):
     base.BaseLmiTestCase.setUpClass.im_func(cls)
     LMIUtil.lmi_set_use_exceptions(cls.USE_EXCEPTIONS)
     if cls.needs_indications():
         cls.indication_port = random.randint(12000, 13000)
         cls.indication_queue = Queue.Queue()
         cls.listener = LMIIndicationListener(
             "0.0.0.0", cls.indication_port)
コード例 #2
0
ファイル: lmibase.py プロジェクト: jsafrane/openlmi-doc
 def _wrapper(*args, **kwargs):
     """ Enable exceptions in wrapped function. """
     original = LMIUtil.lmi_get_use_exceptions()
     LMIUtil.lmi_set_use_exceptions(True)
     try:
         retval = method(*args, **kwargs)
     finally:
         LMIUtil.lmi_set_use_exceptions(original)
     return retval
コード例 #3
0
 def __init__(self):
     # allow exceptions in lmi shell
     LMIUtil.lmi_set_use_exceptions(True)
     # instance of CommandManager, created when first needed
     self._command_manager = None
     self.stdout = sys.stdout
     self.stderr = sys.stderr
     self.stdin = sys.stdin
     # instance of Session, created when needed
     self._session = None
     # instance of Configuration, created in setup()
     self.config = None
     # dictionary of not yet processed options, it's created in setup()
     self._options = None