utils.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:ISB-CGC-pipelines 作者: isb-cgc 项目源码 文件源码
def _verify(self):
        try:
            self.read(self.path)
        except IOError as e:
            print "Couldn't open {path}: {reason}".format(path=self.path, reason=e)
            exit(-1)
        else:
            d = {}
            for name, attrs in self._configParams.iteritems():
                if attrs["required"]:
                    if not self.has_section(attrs["section"]):
                        raise LookupError("missing required section {s} in the configuration!\nRUN `isb-cgc-pipelines config` to correct the configuration".format(s=attrs["section"]))

                    if not self.has_option(attrs["section"], name):
                        raise LookupError("missing required option {o} in section {s}!\nRun `isb-cgc-pipelines config` to correct the configuration".format(s=attrs["section"], o=name))

                try:
                    d[name] = self.get(attrs["section"], name)

                except NoOptionError:
                    pass
                except NoSectionError:
                    pass

            return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号