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


Python Utils.h_fun方法代码示例

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


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

示例1: sig_vars

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def sig_vars(self):
		bld=self.generator.bld
		env=self.env
		upd=self.m.update
		if getattr(self.generator,'fun',None):
			upd(Utils.h_fun(self.generator.fun))
		if getattr(self.generator,'subst_fun',None):
			upd(Utils.h_fun(self.generator.subst_fun))
		vars=self.generator.bld.raw_deps.get(self.uid(),[])
		act_sig=bld.hash_env_vars(env,vars)
		upd(act_sig)
		lst=[getattr(self.generator,x,'')for x in vars]
		upd(Utils.h_list(lst))
		return self.m.digest()
开发者ID:PseudoSky,项目名称:voodoo,代码行数:16,代码来源:TaskGen.py

示例2: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def __init__(cls, name, bases, dict):
		super(store_task_type, cls).__init__(name, bases, dict)
		name = cls.__name__

		if name.endswith('_task'):
			name = name.replace('_task', '')
		if name != 'evil' and name != 'TaskBase':
			global classes

			if getattr(cls, 'run_str', None):
				# if a string is provided, convert it to a method
				(f, dvars) = compile_fun(cls.run_str, cls.shell)
				cls.hcode = cls.run_str
				cls.run_str = None
				cls.run = f
				cls.vars = list(set(cls.vars + dvars))
				cls.vars.sort()
			elif getattr(cls, 'run', None) and not 'hcode' in cls.__dict__:
				# getattr(cls, 'hcode') would look in the upper classes
				cls.hcode = Utils.h_fun(cls.run)

			if not getattr(cls, 'nocache', None):
				cls = cache_outputs(cls)

			# be creative
			getattr(cls, 'register', classes)[name] = cls
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:28,代码来源:Task.py

示例3: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
    def __init__(cls, name, bases, dict):
        super(store_task_type, cls).__init__(name, bases, dict)
        name = cls.__name__

        if name.endswith("_task"):
            name = name.replace("_task", "")
        if name != "evil" and name != "TaskBase":
            global classes

            if getattr(cls, "run_str", None):
                # if a string is provided, convert it to a method
                (f, dvars) = compile_fun(cls.run_str, cls.shell)
                cls.hcode = cls.run_str
                cls.run_str = None
                cls.run = f
                cls.vars = list(set(cls.vars + dvars))
                cls.vars.sort()
            elif getattr(cls, "run", None) and not "hcode" in cls.__dict__:
                # getattr(cls, 'hcode') would look in the upper classes
                cls.hcode = Utils.h_fun(cls.run)

            if not getattr(cls, "nocache", None):
                cls = cache_outputs(cls)

            classes[name] = cls
开发者ID:pombredanne,项目名称:smith,代码行数:27,代码来源:Task.py

示例4: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def __init__(cls, name, bases, dict):
		super(store_task_type, cls).__init__(name, bases, dict)
		name = cls.__name__

		if name.endswith('_task'):
			name = name.replace('_task', '')
		if name != 'evil' and name != 'TaskBase':
			global classes

			if getattr(cls, 'run_str', None):
				# if a string is provided, convert it to a method
				(f, dvars) = compile_fun(cls.run_str, cls.shell)
				cls.hcode = cls.run_str
				cls.orig_run_str = cls.run_str
				# change the name of run_str or it is impossible to subclass with a function
				cls.run_str = None
				cls.run = f
				cls.vars = list(set(cls.vars + dvars))
				cls.vars.sort()
			elif getattr(cls, 'run', None) and not 'hcode' in cls.__dict__:
				# getattr(cls, 'hcode') would look in the upper classes
				cls.hcode = Utils.h_fun(cls.run)

			if sys.hexversion > 0x3000000:
				cls.hcode = cls.hcode.encode('iso8859-1', 'xmlcharrefreplace')

			# be creative
			getattr(cls, 'register', classes)[name] = cls
开发者ID:HI-CARL,项目名称:jack2,代码行数:30,代码来源:Task.py

示例5: sig_vars

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def sig_vars(self):
		"""
		Compute a hash (signature) of the variables used in the substitution
		"""
		bld = self.generator.bld
		env = self.env
		upd = self.m.update

		if getattr(self.generator, 'fun', None):
			upd(Utils.h_fun(self.generator.fun).encode())
		if getattr(self.generator, 'subst_fun', None):
			upd(Utils.h_fun(self.generator.subst_fun).encode())

		# raw_deps: persistent custom values returned by the scanner
		vars = self.generator.bld.raw_deps.get(self.uid(), [])

		# hash both env vars and task generator attributes
		act_sig = bld.hash_env_vars(env, vars)
		upd(act_sig)

		lst = [getattr(self.generator, x, '') for x in vars]
		upd(Utils.h_list(lst))

		return self.m.digest()
开发者ID:u3shit,项目名称:waf,代码行数:26,代码来源:TaskGen.py

示例6: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def __init__(cls,name,bases,dict):
		super(store_task_type,cls).__init__(name,bases,dict)
		name=cls.__name__
		if name.endswith('_task'):
			name=name.replace('_task','')
		if name!='evil'and name!='TaskBase':
			global classes
			if getattr(cls,'run_str',None):
				(f,dvars)=compile_fun(cls.run_str,cls.shell)
				cls.hcode=cls.run_str
				cls.run_str=None
				cls.run=f
				cls.vars=list(set(cls.vars+dvars))
				cls.vars.sort()
			elif getattr(cls,'run',None)and not'hcode'in cls.__dict__:
				cls.hcode=Utils.h_fun(cls.run)
			getattr(cls,'register',classes)[name]=cls
开发者ID:OpenDAWN,项目名称:Minaton,代码行数:19,代码来源:Task.py

示例7: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
 def __init__(cls, name, bases, dict):
     super(store_task_type, cls).__init__(name, bases, dict)
     name = cls.__name__
     if name.endswith("_task"):
         name = name.replace("_task", "")
     if name != "evil" and name != "TaskBase":
         global classes
         if getattr(cls, "run_str", None):
             (f, dvars) = compile_fun(cls.run_str, cls.shell)
             cls.hcode = cls.run_str
             cls.run_str = None
             cls.run = f
             cls.vars.extend(dvars)
         elif getattr(cls, "run", None) and not "hcode" in cls.__dict__:
             cls.hcode = Utils.h_fun(cls.run)
         if not getattr(cls, "nocache", None):
             cls = cache_outputs(cls)
         classes[name] = cls
开发者ID:spo11,项目名称:archlinux,代码行数:20,代码来源:Task.py

示例8: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def __init__(cls, name, bases, dict):
		super(store_task_type, cls).__init__(name, bases, dict)
		name = cls.__name__

		if name.endswith('_task'):
			name = name.replace('_task', '')
		if name != 'evil' and name != 'TaskBase':
			global classes
			classes[name] = cls

			if getattr(cls, 'run_str', None):
				# if a string is provided, convert it to a method
				(f, dvars) = compile_fun(cls.run_str, cls.shell)
				cls.hcode = cls.run_str
				cls.run = f
				cls.vars.extend(dvars)
			elif getattr(cls, 'run', None) and not getattr(cls, 'hcode', None):
				cls.hcode = Utils.h_fun(cls.run)
开发者ID:zsx,项目名称:waf,代码行数:20,代码来源:Task.py

示例9: __init__

# 需要导入模块: from waflib import Utils [as 别名]
# 或者: from waflib.Utils import h_fun [as 别名]
	def __init__(cls,name,bases,dict):
		super(store_task_type,cls).__init__(name,bases,dict)
		name=cls.__name__
		if name.endswith('_task'):
			name=name.replace('_task','')
		if name!='evil'and name!='TaskBase':
			global classes
			if getattr(cls,'run_str',None):
				(f,dvars)=compile_fun(cls.run_str,cls.shell)
				cls.hcode=cls.run_str
				cls.run_str=None
				cls.run=f
				cls.vars.extend(dvars)
			elif getattr(cls,'run',None)and not getattr(cls,'hcode',None):
				cls.hcode=Utils.h_fun(cls.run)
			if not getattr(cls,'nocache',None):
				cls=cache_outputs(cls)
			classes[name]=cls
开发者ID:RunarFreyr,项目名称:waz,代码行数:20,代码来源:Task.py


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