當前位置: 首頁>>代碼示例>>Python>>正文


Python Utils.O644屬性代碼示例

本文整理匯總了Python中waflib.Utils.O644屬性的典型用法代碼示例。如果您正苦於以下問題:Python Utils.O644屬性的具體用法?Python Utils.O644怎麽用?Python Utils.O644使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在waflib.Utils的用法示例。


在下文中一共展示了Utils.O644屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: apply_copy

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def apply_copy(self):
	Utils.def_attrs(self, fun=copy_func)
	self.default_install_path = 0

	lst = self.to_list(self.source)
	self.meths.remove('process_source')

	for filename in lst:
		node = self.path.find_resource(filename)
		if not node: raise Errors.WafError('cannot find input file %s for processing' % filename)

		target = self.target
		if not target or len(lst)>1: target = node.name

		# TODO the file path may be incorrect
		newnode = self.path.find_or_declare(target)

		tsk = self.create_task('copy', node, newnode)
		tsk.fun = self.fun
		tsk.chmod = getattr(self, 'chmod', Utils.O644)

		if not tsk.env:
			tsk.debug()
			raise Errors.WafError('task without an environment') 
開發者ID:ntu-dsi-dcn,項目名稱:ntu-dsi-dcn,代碼行數:26,代碼來源:misc.py

示例2: apply_cs

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def apply_cs(self):
	cs_nodes=[]
	no_nodes=[]
	for x in self.to_nodes(self.source):
		if x.name.endswith('.cs'):
			cs_nodes.append(x)
		else:
			no_nodes.append(x)
	self.source=no_nodes
	bintype=getattr(self,'bintype',self.gen.endswith('.dll')and'library'or'exe')
	self.cs_task=tsk=self.create_task('mcs',cs_nodes,self.path.find_or_declare(self.gen))
	tsk.env.CSTYPE='/target:%s'%bintype
	tsk.env.OUT='/out:%s'%tsk.outputs[0].abspath()
	self.env.append_value('CSFLAGS','/platform:%s'%getattr(self,'platform','anycpu'))
	inst_to=getattr(self,'install_path',bintype=='exe'and'${BINDIR}'or'${LIBDIR}')
	if inst_to:
		mod=getattr(self,'chmod',bintype=='exe'and Utils.O755 or Utils.O644)
		self.install_task=self.bld.install_files(inst_to,self.cs_task.outputs[:],env=self.env,chmod=mod) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:20,代碼來源:cs.py

示例3: apply_subst

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def apply_subst(self):
	Utils.def_attrs(self, fun=subst_func)
	lst = self.to_list(self.source)
	self.meths.remove('process_source')

	self.dict = getattr(self, 'dict', {})

	for filename in lst:
		node = self.path.find_resource(filename)
		if not node: raise Errors.WafError('cannot find input file %s for processing' % filename)

		if self.target:
			newnode = self.path.find_or_declare(self.target)
		else:
			newnode = node.change_ext('')

		try:
			self.dict = self.dict.get_merged_dict()
		except AttributeError:
			pass

		if self.dict and not self.env['DICT_HASH']:
			self.env = self.env.derive()
			keys = list(self.dict.keys())
			keys.sort()
			lst = [self.dict[x] for x in keys]
			self.env['DICT_HASH'] = str(Utils.h_list(lst))

		tsk = self.create_task('copy', node, newnode)
		tsk.fun = self.fun
		tsk.dict = self.dict
		tsk.dep_vars = ['DICT_HASH']
		tsk.chmod = getattr(self, 'chmod', Utils.O644)

		if not tsk.env:
			tsk.debug()
			raise Errors.WafError('task without an environment')

####################
## command-output ####
#################### 
開發者ID:ntu-dsi-dcn,項目名稱:ntu-dsi-dcn,代碼行數:43,代碼來源:misc.py

示例4: apply_intltool_po

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def apply_intltool_po(self):
	try:self.meths.remove('process_source')
	except ValueError:pass
	self.ensure_localedir()
	appname=getattr(self,'appname',getattr(Context.g_module,Context.APPNAME,'set_your_app_name'))
	podir=getattr(self,'podir','.')
	inst=getattr(self,'install_path','${LOCALEDIR}')
	linguas=self.path.find_node(os.path.join(podir,'LINGUAS'))
	if linguas:
		file=open(linguas.abspath())
		langs=[]
		for line in file.readlines():
			if not line.startswith('#'):
				langs+=line.split()
		file.close()
		re_linguas=re.compile('[-a-zA-Z_@.]+')
		for lang in langs:
			if re_linguas.match(lang):
				node=self.path.find_resource(os.path.join(podir,re_linguas.match(lang).group()+'.po'))
				task=self.create_task('po',node,node.change_ext('.mo'))
				if inst:
					filename=task.outputs[0].name
					(langname,ext)=os.path.splitext(filename)
					inst_file=inst+os.sep+langname+os.sep+'LC_MESSAGES'+os.sep+appname+'.mo'
					self.bld.install_as(inst_file,task.outputs[0],chmod=getattr(self,'chmod',Utils.O644),env=task.env)
	else:
		Logs.pprint('RED',"Error no LINGUAS file found in po directory") 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:29,代碼來源:intltool.py

示例5: apply_msgfmt

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def apply_msgfmt(self):
	for lang in self.to_list(self.langs):
		node=self.path.find_resource(lang+'.po')
		task=self.create_task('msgfmt',node,node.change_ext('.mo'))
		langname=lang.split('/')
		langname=langname[-1]
		inst=getattr(self,'install_path','${KDE4_LOCALE_INSTALL_DIR}')
		self.bld.install_as(inst+os.sep+langname+os.sep+'LC_MESSAGES'+os.sep+getattr(self,'appname','set_your_appname')+'.mo',task.outputs[0],chmod=getattr(self,'chmod',Utils.O644)) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:10,代碼來源:kde4.py

示例6: copy_fun

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def copy_fun(self,src,tgt,**kw):
		if Utils.is_win32 and len(tgt)>259 and not tgt.startswith('\\\\?\\'):
			tgt='\\\\?\\'+tgt
		shutil.copy2(src,tgt)
		os.chmod(tgt,kw.get('chmod',Utils.O644)) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:7,代碼來源:Build.py

示例7: do_install

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def do_install(self,src,tgt,**kw):
		d,_=os.path.split(tgt)
		if not d:
			raise Errors.WafError('Invalid installation given %r->%r'%(src,tgt))
		Utils.check_dir(d)
		srclbl=src.replace(self.srcnode.abspath()+os.sep,'')
		if not Options.options.force:
			try:
				st1=os.stat(tgt)
				st2=os.stat(src)
			except OSError:
				pass
			else:
				if st1.st_mtime+2>=st2.st_mtime and st1.st_size==st2.st_size:
					if not self.progress_bar:
						Logs.info('- install %s (from %s)'%(tgt,srclbl))
					return False
		if not self.progress_bar:
			Logs.info('+ install %s (from %s)'%(tgt,srclbl))
		try:
			os.chmod(tgt,Utils.O644|stat.S_IMODE(os.stat(tgt).st_mode))
		except EnvironmentError:
			pass
		try:
			os.remove(tgt)
		except OSError:
			pass
		try:
			self.copy_fun(src,tgt,**kw)
		except IOError:
			try:
				os.stat(src)
			except EnvironmentError:
				Logs.error('File %r does not exist'%src)
			raise Errors.WafError('Could not install the file %r'%tgt) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:37,代碼來源:Build.py

示例8: install_as

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def install_as(self,dest,srcfile,env=None,chmod=Utils.O644,cwd=None,add=True,postpone=True,task=None):
		tsk=inst(env=env or self.env)
		tsk.bld=self
		tsk.path=cwd or self.path
		tsk.chmod=chmod
		tsk.source=[srcfile]
		tsk.task=task
		tsk.dest=dest
		tsk.exec_task=tsk.exec_install_as
		if add:self.add_to_group(tsk)
		self.run_task_now(tsk,postpone)
		return tsk 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:14,代碼來源:Build.py

示例9: install_as

# 需要導入模塊: from waflib import Utils [as 別名]
# 或者: from waflib.Utils import O644 [as 別名]
def install_as(self,dest,srcfile,env=None,chmod=Utils.O644,cwd=None,add=True,postpone=True,task=None):
		assert(dest)
		tsk=inst(env=env or self.env)
		tsk.bld=self
		tsk.path=cwd or self.path
		tsk.chmod=chmod
		tsk.source=[srcfile]
		tsk.task=task
		tsk.dest=dest
		tsk.exec_task=tsk.exec_install_as
		if add:self.add_to_group(tsk)
		self.run_task_now(tsk,postpone)
		return tsk 
開發者ID:KTH,項目名稱:royal-chaos,代碼行數:15,代碼來源:Build.py


注:本文中的waflib.Utils.O644屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。