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


Python Utils.str_to_dict方法代码示例

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


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

示例1: runnable_status

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import str_to_dict [as 别名]
	def runnable_status(self):
		'''
		self.pars are populated in runnable_status - because this function is being
		run *before* both self.pars "consumers" - scan() and run()

		set output_dir (node) for the output
		'''

		for x in self.run_after:
			if not x.hasrun:
				return Task.ASK_LATER

		if not getattr(self, 'pars', None):
			txt = self.inputs[0].read()
			txt = re_nl.sub('', txt)
			self.pars = Utils.str_to_dict(txt)
			if not self.pars.get('OUTPUT_DIRECTORY'):
				self.pars['OUTPUT_DIRECTORY'] = self.inputs[0].parent.get_bld().abspath()
			if not self.pars.get('INPUT'):
				self.pars['INPUT'] = self.inputs[0].parent.abspath()

		if not getattr(self, 'output_dir', None):
			self.output_dir = self.generator.bld.root.find_dir(self.pars['OUTPUT_DIRECTORY'])

		self.signature()
		return Task.Task.runnable_status(self)
开发者ID:RedHatter,项目名称:diodon-plugins,代码行数:28,代码来源:doxygen.py

示例2: runnable_status

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import str_to_dict [as 别名]
    def runnable_status(self):
        """
		self.pars are populated in runnable_status - because this function is being
		run *before* both self.pars "consumers" - scan() and run()

		set output_dir (node) for the output
		"""

        for x in self.run_after:
            if not x.hasrun:
                return Task.ASK_LATER

        if not getattr(self, "pars", None):
            txt = self.inputs[0].read()
            txt = re_nl.sub("", txt)
            self.pars = Utils.str_to_dict(txt)
            if not self.pars.get("OUTPUT_DIRECTORY"):
                self.pars["OUTPUT_DIRECTORY"] = self.inputs[0].parent.get_bld().abspath()
            if not self.pars.get("INPUT"):
                self.pars["INPUT"] = self.inputs[0].parent.abspath()

        if not getattr(self, "output_dir", None):
            bld = self.generator.bld
            # First try to find an absolute path, then find or declare a relative path
            self.output_dir = bld.root.find_dir(self.pars["OUTPUT_DIRECTORY"])
            if not self.output_dir:
                self.output_dir = bld.path.find_or_declare(self.pars["OUTPUT_DIRECTORY"])

        self.signature()
        return Task.Task.runnable_status(self)
开发者ID:AnonymousPBoC,项目名称:rtems-tools,代码行数:32,代码来源:doxygen.py

示例3: run

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import str_to_dict [as 别名]
  def run(self):
    src = self.inputs[0]
    sbf = self.inputs[0].change_ext('.sbf').get_bld()
    sbf.parent.mkdir()
    cmd = '%s -b %s -I %s -c ./ %s' % (self.env.SIP_BIN, sbf.abspath(), src.parent.abspath(), src.abspath())
    cwd = src.parent.get_bld().abspath()
    self.generator.bld.exec_command(cmd, cwd=cwd)

    sbf_data = Utils.str_to_dict(sbf.read())
    headers = Utils.to_list(sbf_data['headers'])
    sources = Utils.to_list(sbf_data['sources'])

    src_dir = src.parent.get_bld()
    self.outputs = [src_dir.find_or_declare(x) for x in sources]
    self.generator.bld.raw_deps[self.uid()] = [self.signature()] + self.outputs
    self.add_c_tasks(self.outputs)
开发者ID:Shallouf,项目名称:Genius-TCAD-Open,代码行数:18,代码来源:siptool.py


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