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


Python Utils.deque方法代码示例

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


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

示例1: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import deque [as 别名]
	def __init__(self,bld,j=2):
		self.numjobs=j
		self.bld=bld
		self.outstanding=Utils.deque()
		self.frozen=Utils.deque()
		self.ready=Queue(0)
		self.out=Queue(0)
		self.count=0
		self.processed=1
		self.stop=False
		self.error=[]
		self.biter=None
		self.dirty=False
		self.spawner=Spawner(self)
开发者ID:allencubie,项目名称:lib,代码行数:16,代码来源:Runner.py

示例2: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import deque [as 别名]
	def __init__(self, bld, j=2):
		"""
		The initialization requires a build context reference
		for computing the total number of jobs.
		"""

		self.numjobs = j
		"""
		Amount of parallel consumers to use
		"""

		self.bld = bld
		"""
		Instance of :py:class:`waflib.Build.BuildContext`
		"""

		self.outstanding = Utils.deque()
		"""List of :py:class:`waflib.Task.TaskBase` that may be ready to be executed"""

		self.frozen = Utils.deque()
		"""List of :py:class:`waflib.Task.TaskBase` that are not ready yet"""

		self.ready = Queue(0)
		"""List of :py:class:`waflib.Task.TaskBase` ready to be executed by consumers"""

		self.out = Queue(0)
		"""List of :py:class:`waflib.Task.TaskBase` returned by the task consumers"""

		self.count = 0
		"""Amount of tasks that may be processed by :py:class:`waflib.Runner.TaskConsumer`"""

		self.processed = 1
		"""Amount of tasks processed"""

		self.stop = False
		"""Error flag to stop the build"""

		self.error = []
		"""Tasks that could not be executed"""

		self.biter = None
		"""Task iterator which must give groups of parallelizable tasks when calling ``next()``"""

		self.dirty = False
		"""
		Flag that indicates that the build cache must be saved when a task was executed
		(calls :py:meth:`waflib.Build.BuildContext.store`)"""

		self.spawner = Spawner(self)
		"""
开发者ID:JodyGoldberg,项目名称:waf,代码行数:52,代码来源:Runner.py

示例3: apply_uselib_local

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import deque [as 别名]
def apply_uselib_local(self):
    env = self.env
    from waflib.Tools.ccroot import stlink_task

    self.uselib = self.to_list(getattr(self, "uselib", []))
    self.includes = self.to_list(getattr(self, "includes", []))
    names = self.to_list(getattr(self, "uselib_local", []))
    get = self.bld.get_tgen_by_name
    seen = set([])
    seen_uselib = set([])
    tmp = Utils.deque(names)
    if tmp:
        if Logs.verbose:
            Logs.warn('compat: "uselib_local" is deprecated, replace by "use"')
    while tmp:
        lib_name = tmp.popleft()
        if lib_name in seen:
            continue
        y = get(lib_name)
        y.post()
        seen.add(lib_name)
        if getattr(y, "uselib_local", None):
            for x in self.to_list(getattr(y, "uselib_local", [])):
                obj = get(x)
                obj.post()
                if getattr(obj, "link_task", None):
                    if not isinstance(obj.link_task, stlink_task):
                        tmp.append(x)
        if getattr(y, "link_task", None):
            link_name = y.target[y.target.rfind(os.sep) + 1 :]
            if isinstance(y.link_task, stlink_task):
                env.append_value("STLIB", [link_name])
            else:
                env.append_value("LIB", [link_name])
            self.link_task.set_run_after(y.link_task)
            self.link_task.dep_nodes += y.link_task.outputs
            tmp_path = y.link_task.outputs[0].parent.bldpath()
            if not tmp_path in env["LIBPATH"]:
                env.prepend_value("LIBPATH", [tmp_path])
        for v in self.to_list(getattr(y, "uselib", [])):
            if v not in seen_uselib:
                seen_uselib.add(v)
                if not env["STLIB_" + v]:
                    if not v in self.uselib:
                        self.uselib.insert(0, v)
        if getattr(y, "export_includes", None):
            self.includes.extend(y.to_incnodes(y.export_includes))
开发者ID:faddat,项目名称:lib,代码行数:49,代码来源:compat15.py

示例4: apply_uselib_local

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import deque [as 别名]
def apply_uselib_local(self):
	"""
	process the uselib_local attribute
	execute after apply_link because of the execution order set on 'link_task'
	"""
	env = self.env
	from waflib.Tools.ccroot import stlink_task

	# 1. the case of the libs defined in the project (visit ancestors first)
	# the ancestors external libraries (uselib) will be prepended
	self.uselib = self.to_list(getattr(self, 'uselib', []))
	self.includes = self.to_list(getattr(self, 'includes', []))
	names = self.to_list(getattr(self, 'uselib_local', []))
	get = self.bld.get_tgen_by_name
	seen = set()
	seen_uselib = set()
	tmp = Utils.deque(names) # consume a copy of the list of names
	if tmp:
		if Logs.verbose:
			Logs.warn('compat: "uselib_local" is deprecated, replace by "use"')
	while tmp:
		lib_name = tmp.popleft()
		# visit dependencies only once
		if lib_name in seen:
			continue

		y = get(lib_name)
		y.post()
		seen.add(lib_name)

		# object has ancestors to process (shared libraries): add them to the end of the list
		if getattr(y, 'uselib_local', None):
			for x in self.to_list(getattr(y, 'uselib_local', [])):
				obj = get(x)
				obj.post()
				if getattr(obj, 'link_task', None):
					if not isinstance(obj.link_task, stlink_task):
						tmp.append(x)

		# link task and flags
		if getattr(y, 'link_task', None):

			link_name = y.target[y.target.rfind(os.sep) + 1:]
			if isinstance(y.link_task, stlink_task):
				env.append_value('STLIB', [link_name])
			else:
				# some linkers can link against programs
				env.append_value('LIB', [link_name])

			# the order
			self.link_task.set_run_after(y.link_task)

			# for the recompilation
			self.link_task.dep_nodes += y.link_task.outputs

			# add the link path too
			tmp_path = y.link_task.outputs[0].parent.bldpath()
			if not tmp_path in env['LIBPATH']:
				env.prepend_value('LIBPATH', [tmp_path])

		# add ancestors uselib too - but only propagate those that have no staticlib defined
		for v in self.to_list(getattr(y, 'uselib', [])):
			if v not in seen_uselib:
				seen_uselib.add(v)
				if not env['STLIB_' + v]:
					if not v in self.uselib:
						self.uselib.insert(0, v)

		# if the library task generator provides 'export_includes', add to the include path
		# the export_includes must be a list of paths relative to the other library
		if getattr(y, 'export_includes', None):
			self.includes.extend(y.to_incnodes(y.export_includes))
开发者ID:afeldman,项目名称:waf,代码行数:74,代码来源:compat15.py


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