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


Python History.main_process方法代码示例

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


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

示例1: update_slices

# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import main_process [as 别名]
    def update_slices(self, path, project = None, sample = None,
                      info = None, timestring = None):
        """
        Creates and uploads slice images for a single NetCDF data set at
        location <path>. If <project> and <sample> are not specified,
        they are extracted from the absolute path. Additional information
        is passed in <info> and <timestring>.
        
        The response received from Plexus is written to self.output.
        """

        if not (info.get('IdExt') or info.get('IdInt')):
            return

        seen = info['Images']

        if self.slices_missing(seen, SLICE_SIZES):
            if self.dry_run:
                s = slices(path, seen, self.replace, true)
                for (data, name, action) in s:
                    self.print_action(project, sample, os.path.dirname(path),
                                      name, action)
            else:
                history = History(nc3info(path), path,
                                  time.gmtime(os.path.getmtime(path)))
                main = history.main_process().record
                meta = dict((k, main[k]) for k in ["data_file",
                                                   "data_type",
                                                   "date",
                                                   "domain",
                                                   "identifier",
                                                   "name",
                                                   "predecessors",
                                                   "process",
                                                   "run_by"])
                meta['path'] = os.path.abspath(path)

                s = slices(path, seen, self.replace, self.mock_slices,
                           sizes = SLICE_SIZES, info = meta)
                for (data, name, action) in s:
                    self.upload_files(project, sample, timestring,
                                      ((data, name),), info)
        else:
            self.log.info("Slices look complete. Skipped slice generation.")
开发者ID:odf,项目名称:PlexusIngest,代码行数:46,代码来源:update_plexus.py


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