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


Python Output.close方法代码示例

本文整理汇总了Python中output.Output.close方法的典型用法代码示例。如果您正苦于以下问题:Python Output.close方法的具体用法?Python Output.close怎么用?Python Output.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在output.Output的用法示例。


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

示例1: run

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import close [as 别名]
def run(*datasources, **options):
    """Executes given Robot data sources with given options.

    Data sources are paths to files and directories, similarly as when running
    pybot/jybot from command line. Options are given as keywords arguments and
    their names are same as long command line options without hyphens.

    Examples:
    run('/path/to/tests.html')
    run('/path/to/tests.html', '/path/to/tests2.html', log='mylog.html')

    Equivalent command line usage:
    pybot /path/to/tests.html
    pybot --log mylog.html /path/to/tests.html /path/to/tests2.html
    """
    STOP_SIGNAL_MONITOR.start()
    settings = RobotSettings(options)
    LOGGER.register_console_logger(settings['MonitorWidth'],
                                   settings['MonitorColors'])
    init_global_variables(settings)
    suite = TestSuite(datasources, settings)
    output = Output(settings)
    suite.run(output)
    LOGGER.info("Tests execution ended. Statistics:\n%s"
                % suite.get_stat_message())
    output.close(suite)
    if settings.is_rebot_needed():
        output, settings = settings.get_rebot_datasource_and_settings()
        ResultWriter(settings).write_robot_results(output)
    LOGGER.close()
    return suite
开发者ID:hhakkala,项目名称:robotframework-selenium2library-boilerplate,代码行数:33,代码来源:__init__.py

示例2: render_save

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import close [as 别名]
 def render_save(self, varlist, outputfile=None):
     """Render and save to file"""
     rendered_str = self.render(varlist)
     out = Output(outputfile)
     out.write(rendered_str)
     out.close()
     return outputfile
开发者ID:UdeM-LBIT,项目名称:CoreTracker,代码行数:9,代码来源:template.py

示例3: walk

# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import close [as 别名]
 def walk(self):
     self.co.create()
     output = Output(self.kind)
     output.now_dir()
     print '[+] now path: ' + str(output.nowpath())
     output.out_dir()
     output.out_file()
     print '[+] target path: ' + str(self.__path)
     header = "target : " + self.__path + '\n'
     print '[+] please wait ...'
     output.write(header)
     for root, dirs, files in os.walk(self.__path):
         level = root.replace(self.__path, '').count(os.sep)
         indent = ' ' * 4 * (level)
         out = '{0}--=> {1}/'.format(indent, os.path.basename(root)) + '\n'
         output.write(out)
         subindent = ' ' * 4 * (level + 1)
         for f in files:
             #c_path = os.path.basename(root) + '/' + f
             f_name = f
             f_path = os.path.join(root, f)
             if self.checking(f_path) == 2:
                 f_md5 = self.md5(f_path)
                 self.co.into(self.kind, f_name, f_path, f_md5)
             out = '{0}=> {1}'.format(subindent, f) + '\n'
             output.write(out)
     self.co.close()
     output.close()
开发者ID:AnwarMohamed,项目名称:Catcher,代码行数:30,代码来源:extractor.py


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