本文整理汇总了Python中target.Target.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Target.__init__方法的具体用法?Python Target.__init__怎么用?Python Target.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类target.Target
的用法示例。
在下文中一共展示了Target.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
outs,
cmd,
blade,
kwargs):
"""Init method.
Init the gen rule target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
outs = var_to_list(outs)
Target.__init__(self,
name,
'gen_rule',
srcs,
deps,
blade,
kwargs)
self.data['outs'] = outs
self.data['cmd'] = cmd
示例2: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
type,
srcs,
deps,
base,
visibility,
kwargs):
"""Init method. """
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
type,
srcs,
deps,
visibility,
blade.blade,
kwargs)
if base:
if not base.startswith('//'):
console.error_exit('%s: Invalid base directory %s. Option base should '
'be a directory starting with \'//\' from BLADE_ROOT directory.' %
(self.fullname, base))
self.data['python_base'] = base[2:]
self.data['python_sources'] = [self._source_file_path(s) for s in srcs]
示例3: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
target_type,
srcs,
deps,
warning,
defs,
incs,
export_incs,
optimize,
extra_cppflags,
extra_linkflags,
blade,
kwargs):
"""Init method.
Init the cc target.
"""
srcs_list = var_to_list(srcs)
srcs = []
for item in srcs_list:
if (';' in item):
# file list expanded with asterisk wildcard
file_name_array = string.split(item, ';')
for file_name in file_name_array:
srcs.append(file_name)
else:
srcs.append(item)
deps = var_to_list(deps)
defs = var_to_list(defs)
incs = var_to_list(incs)
export_incs = var_to_list(export_incs)
opt = var_to_list(optimize)
extra_cppflags = var_to_list(extra_cppflags)
extra_linkflags = var_to_list(extra_linkflags)
Target.__init__(self,
name,
target_type,
srcs,
deps,
blade,
kwargs)
self.data['warning'] = warning
self.data['defs'] = defs
# add by zxy([email protected]) 20140929 support absolute include path (/common/gsl/include)
for index, item in enumerate(incs):
if (item.startswith('/')):
incs[index] = find_relative_path(self.path, item)
#end
self.data['incs'] = incs
self.data['export_incs'] = export_incs
self.data['optimize'] = opt
self.data['extra_cppflags'] = extra_cppflags
self.data['extra_linkflags'] = extra_linkflags
self._check_defs()
self._check_incorrect_no_warning()
示例4: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
outs,
cmd,
blade,
kwargs):
"""Init method.
Init the gen rule target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
outs = var_to_list(outs)
Target.__init__(self,
name,
'gen_rule',
srcs,
deps,
None,
blade,
kwargs)
self.data['outs'] = outs
self.data['locations'] = []
self.data['cmd'] = location_re.sub(self._process_location_reference, cmd)
示例5: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
prebuilt,
blade,
kwargs):
"""Init method.
Init the java jar target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
'java_jar',
srcs,
deps,
blade,
kwargs)
if prebuilt:
self.type = 'prebuilt_java_jar'
self.data['jar_class_path'] = self._prebuilt_java_jar_src_path()
self.data['java_jars'] = []
self.java_jar_cmd_list = []
self.cmd_var_list = []
self.java_jar_after_dep_source_list = []
self.targets_dependency_map = {}
self.java_jar_dep_vars = {}
示例6: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
type,
out,
blade,
kwargs):
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
'package',
[],
deps,
None,
blade,
kwargs)
if type not in _package_types:
console.error_exit('%s: Invalid type %s. Types supported '
'by the package are %s' % (
self.fullname, type, ', '.join(sorted(_package_types))))
self.data['type'] = type
self.data['sources'], self.data['locations'] = [], []
self._process_srcs(srcs)
if not out:
out = '%s.%s' % (name, type)
self.data['out'] = out
示例7: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
type,
srcs,
deps,
resources,
source_encoding,
warnings,
kwargs):
"""Init method.
Init the java jar target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
resources = var_to_list(resources)
Target.__init__(self,
name,
type,
srcs,
deps,
None,
blade.blade,
kwargs)
self._process_resources(resources)
self.data['source_encoding'] = source_encoding
if warnings is not None:
self.data['warnings'] = var_to_list(warnings)
示例8: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
prebuilt,
blade,
kwargs):
"""Init method.
Init the java jar target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
'java_jar',
srcs,
deps,
blade,
kwargs)
if prebuilt:
self.data['type'] = 'prebuilt_java_jar'
self.java_jar_cmd_list = []
self.cmd_var_list = []
self.java_jar_after_dep_source_list = []
self.targets_dependency_map = {}
self.java_jar_dep_vars = {}
self.java_jars_map = self.blade.get_java_jars_map()
self.sources_dependency_map = self.blade.get_sources_explict_dependency_map()
示例9: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self, fname, *args, **kwargs):
self.pass_filename = kwargs.get('pass_filename', False)
if 'pass_filename' in kwargs:
del kwargs['pass_filename']
Target.__init__(self, *args, **kwargs)
if self.pass_filename:
self.passes = 1
self.filename = fname
示例10: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
target_type,
srcs,
deps,
warning,
defs,
incs,
export_incs,
optimize,
extra_cppflags,
extra_linkflags,
install_dir,
extra_cmds,
blade,
kwargs):
"""Init method.
Init the cc target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
defs = var_to_list(defs)
incs = var_to_list(incs)
export_incs = var_to_list(export_incs)
opt = var_to_list(optimize)
extra_cppflags = var_to_list(extra_cppflags)
extra_linkflags = var_to_list(extra_linkflags)
extra_cmds = var_to_list(extra_cmds)
Target.__init__(self,
name,
target_type,
srcs,
deps,
blade,
kwargs)
self.data['warning'] = warning
self.data['defs'] = defs
self.data['incs'] = incs
self.data['export_incs'] = export_incs
self.data['optimize'] = opt
self.data['extra_cppflags'] = extra_cppflags
self.data['extra_linkflags'] = extra_linkflags
self.data['install_dir'] = install_dir
self.data['extra_cmds'] = extra_cmds
self._check_defs()
self._check_incorrect_no_warning()
示例11: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
testdata,
kwargs):
srcs = var_to_list(srcs)
deps = var_to_list(deps)
testdata = var_to_list(testdata)
Target.__init__(self,
name,
'sh_test',
srcs,
deps,
None,
blade.blade,
kwargs)
self._process_test_data(testdata)
示例12: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
srcs,
deps,
prebuilt,
blade,
kwargs):
"""Init method. """
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
'py_binary',
srcs,
deps,
blade,
kwargs)
if prebuilt:
self.data['type'] = 'prebuilt_py_binary'
示例13: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
type,
srcs,
deps,
kwargs):
"""Init the go target. """
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
type,
srcs,
deps,
None,
blade.blade,
kwargs)
self._set_go_package()
self._init_go_environment()
示例14: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self,
name,
type,
srcs,
deps,
prebuilt,
blade,
kwargs):
"""Init method.
Init the java jar target.
"""
srcs = var_to_list(srcs)
deps = var_to_list(deps)
Target.__init__(self,
name,
type,
srcs,
deps,
blade,
kwargs)
示例15: __init__
# 需要导入模块: from target import Target [as 别名]
# 或者: from target.Target import __init__ [as 别名]
def __init__(self, name, command, shell=False, echo=True, cwd=None, **kwargs):
Target.__init__(self, name, **kwargs)
self.command = command
self.cwd = cwd
self.echo = echo
self.shell = shell