当前位置: 首页>>代码示例>>Python>>正文


Python logger.Logger类代码示例

本文整理汇总了Python中lib.reporting.logger.Logger的典型用法代码示例。如果您正苦于以下问题:Python Logger类的具体用法?Python Logger怎么用?Python Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _find_ctrl

 def _find_ctrl(self, parent, name=None, label=None, wxid=None, pos=None, wx_classname=None):
     try:
         self.find_wx_ctrl(parent, name, label, wxid, pos, wx_classname)
         self.find_win_ctrl(parent, name, label, wxid, pos, wx_classname)
     except Found, ex:
         Logger.add_debug(ex.message)
         return
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:7,代码来源:ctrlfinder.py

示例2: describe_wxdialog

 def describe_wxdialog(self, win, level=0):
     if win is None:
         return
     Logger.newline()
     Logger.bold_header("wx Description\n  Name:             '%s'\n  ClassName:        '%s'\n  Label:            '%s'\n  Nbr of children:  %d" % (win.get_name(), win.get_classname(), win.get_label(), win.get_nbr_of_children()))
     if win.get_nbr_of_children() > 0:
         self.describe_wxdialog_windows(win)
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:7,代码来源:window.py

示例3: _test

 def _test(self):
     Logger.set_path(self.manuscript.get_log_path())
     Logger.set_log_dialog_descriptions(self.appargs.log_dialog_descriptions())
     Logger.add_debug("Application arguments")
     Logger.add_debug(" ".join(sys.argv))
     Logger.add_section("Manuscript", u"%s" % self.manuscript)
     instructions = Instructions(self.manuscript, self.appargs.timedelay())
     start_app(instructions, self.appargs.program())
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:8,代码来源:testengine.py

示例4: describe

 def describe(self, frame):
     try:
         menu_bar = frame.GetMenuBar()
         if menu_bar is not None:
             self.describe_menu_bar(menu_bar)
             Logger.add(" ")
     except AttributeError:
         pass
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:8,代码来源:menubar.py

示例5: run

 def run(self):
     if self.appargs.investigate():
         self._log_effective_manuscript()
     else:
         try:
             self._test()
         finally:
             Logger.log()
     return not Logger.has_errors()
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:9,代码来源:testengine.py

示例6: register_dialog

 def register_dialog(self, win=None):
     if win is None:
         return
     Logger.add_debug("Registering window: %s" % win)
     self.windows.append(win)
     if not self.execution_started:
         Logger.add_instruction("Execution of instructions start")
         self.execution_started = True
         wx.CallLater(TIME_TO_WAIT_BEFORE_CONTINUING_IN_MILLISECONDS, self.execute_next_instruction)
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:9,代码来源:instructions.py

示例7: wrap

 def wrap(instruction_line, tokens):
     try:
         rv = f(instruction_line, tokens)
         if rv is None:
             raise InstructionSyntaxException("")
         else:
             return rv
     except InstructionSyntaxException:
         Logger.add_error("Invalid instruction: '%s'. Instruction ignored" % instruction_line)
         raise
开发者ID:rickardlindberg,项目名称:autopilot,代码行数:10,代码来源:parser.py

示例8: find_menu

 def find_menu(self, args):
     try:
         win = wx.GetApp().GetTopWindow()
         item_id = self._find_menu_item_id(args)
         if item_id != wx.NOT_FOUND:
             self.item_id = item_id
             raise Found("Menu found")
     except Found, ex:
         Logger.add_debug(ex.message)
         return
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:10,代码来源:ctrlfinder.py

示例9: find_win_by_name_or_label

 def find_win_by_name_or_label(self, name_or_label):
     self.wxctrl = None
     self.winctrl = None
     try:
         if name_or_label is None:
             self.wxctrl = wx.GetApp().GetTopWindow()
             raise Found("Top window")
         for name in name_or_label.split("|"):
             name = name.strip()
             self.find_wx_win(name, name)
             self.find_win_win(name)
     except Found, ex:
         Logger.add_debug(ex.message)
         return
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:14,代码来源:ctrlfinder.py

示例10: execute_next_instruction

 def execute_next_instruction(self):
     try:
         instruction = self._next_instruction()
         instruction._replace_placeholders()
         self._display_instruction_in_popup_window(instruction)
         if isinstance(instruction, AddPlaceholderInstruction):
             delay = 0
         else:
             # TODO: We have some timing problem so we can't set
             #       waiting time to 0. 40 seems to be ok,
             delay = max(40, self.timedelay * 1000)
         Logger.add_debug("Preparing instruction '%s' for execution with delay %d" % (instruction, delay))
         wx.CallLater(delay, self._execute_instruction, instruction)
     except NoMoreInstructionsException:
         Logger.add_instruction("The last instruction has been executed")
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:15,代码来源:instructions.py

示例11: describe_menu

 def describe_menu(self, menu, name):
     Logger.add(" ")
     Logger.add("   Menu: '%s'    Item count: %d" % (name, menu.MenuItemCount))
     Logger.add("        Id   Label                      Text")
     Logger.add("      ----   ------------------------   ---------------------")
     for item in menu.MenuItems:
         self.describe_menu_item(item)
         if item.SubMenu is not None and item.SubMenu.MenuItemCount > 0:
             self.describe_submenu(item.SubMenu)
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:9,代码来源:menubar.py

示例12: __init__

 def __init__(self, manuscript, timedelay):
     self.timedelay = timedelay
     self.popup = None
     self.execution_started = False
     self.windows = []
     self.instructions = []
     for line in [
         line for line in manuscript.get_instructions() if not line.startswith("#") and len(line.strip()) > 0
     ]:
         try:
             instruction = parse(line)
         except Exception:
             Logger.add_error("Can't parse instruction: '%s'" % line)
             raise
         if instruction is not None:
             self.instructions.append(instruction)
     collector = []
     for instruction in self.instructions:
         collector.append(instruction.to_unicode())
     Logger.header("Effective Instructions:\n   %s" % "\n   ".join(collector))
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:20,代码来源:instructions.py

示例13: describe_children

 def describe_children(self, hwnd):
     Logger.add("    hwnd     Classname                 ScreenPos    Label")
     Logger.add("    -------  ------------------------  ------------ ------------------")
     children = facade.get_children(hwnd)
     for hwnd, class_name, text in children:
         rect = facade.get_window_rect(hwnd)
         Logger.add("   %8d  %-24.24s  (%4d, %4d) '%s'" % (hwnd, class_name, rect[0], rect[1], text))
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:7,代码来源:window.py

示例14: _validate_windows

 def _validate_windows(self):
     """Make sure the topmost window in the list self.windows is still
     valid. If not, remove it from the list and continue checking the
     list until the list is exhausted or a valid dialog is found.
     """
     self.windows.reverse()
     while len(self.windows) > 1:
         win = self.windows[0]
         try:
             win.get_label()
             try:
                 if not win.IsShown():
                     self.windows = self.windows[1:]
                 else:
                     break
             except:
                 Logger.add_debug("Window is not visible")
                 break
         except:
             Logger.add_debug("get_window_text fails")
             self.windows = self.windows[1:]
     self.windows.reverse()
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:22,代码来源:instructions.py

示例15: run_python_file

def run_python_file(args):
        """Run a python file as if it were the main program on the command line.

        `args` is the argument array to present as sys.argv, including the first
        element representing the file being executed.

        Lifted straight from coverage.py by Ned Batchelder

        """
        try:
            # In Py 2.x, the builtins were in __builtin__
            BUILTINS = sys.modules['__builtin__']
        except KeyError:  # pragma: no cover - not worried about Python 3 yet...
            # In Py 3.x, they're in builtins
            BUILTINS = sys.modules['builtins']

        filename = args[0]

        # Create a module to serve as __main__
        old_main_mod = sys.modules['__main__']
        main_mod = imp.new_module('__main__')
        sys.modules['__main__'] = main_mod
        main_mod.__file__ = filename
        main_mod.__builtins__ = BUILTINS

        # Set sys.argv and the first path element properly.
        old_argv = sys.argv
        old_path0 = sys.path[0]
        sys.argv = args
        sys.path[0] = os.path.dirname(filename)

        try:
            sys.stdout = open('outfile.txt', 'w')
            source = open(filename, 'rU').read()
            exec compile(source, filename, "exec") in main_mod.__dict__
        except Exception, ex:
            Logger.add_error("%s" % ex)
            Logger.failure("Exception in application")
开发者ID:rogerlindberg,项目名称:autopilot,代码行数:38,代码来源:pythonlauncher.py


注:本文中的lib.reporting.logger.Logger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。