本文整理汇总了Python中mozbuild.makeutil.Makefile.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Makefile.__init__方法的具体用法?Python Makefile.__init__怎么用?Python Makefile.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozbuild.makeutil.Makefile
的用法示例。
在下文中一共展示了Makefile.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mozbuild.makeutil import Makefile [as 别名]
# 或者: from mozbuild.makeutil.Makefile import __init__ [as 别名]
def __init__(self, topsrcdir, topobjdir, dist, group=Grouping.NO,
abspaths=False):
topsrcdir = mozpath.normsep(os.path.normcase(os.path.abspath(topsrcdir)))
topobjdir = mozpath.normsep(os.path.normcase(os.path.abspath(topobjdir)))
dist = mozpath.normsep(os.path.normcase(os.path.abspath(dist)))
if abspaths:
topsrcdir_value = topsrcdir
topobjdir_value = topobjdir
dist_value = dist
else:
topsrcdir_value = '$(topsrcdir)'
topobjdir_value = '$(DEPTH)'
dist_value = '$(DIST)'
self._normpaths = {
topsrcdir: topsrcdir_value,
topobjdir: topobjdir_value,
dist: dist_value,
'$(topsrcdir)': topsrcdir_value,
'$(DEPTH)': topobjdir_value,
'$(DIST)': dist_value,
'$(depth)': topobjdir_value, # normcase may lowercase variable refs when
'$(dist)': dist_value, # they are in the original dependency file
mozpath.relpath(topsrcdir, os.curdir): topsrcdir_value,
mozpath.relpath(topobjdir, os.curdir): topobjdir_value,
mozpath.relpath(dist, os.curdir): dist_value,
}
Makefile.__init__(self)
self._group = group
self._targets = OrderedDict()
示例2: __init__
# 需要导入模块: from mozbuild.makeutil import Makefile [as 别名]
# 或者: from mozbuild.makeutil.Makefile import __init__ [as 别名]
def __init__(self, topsrcdir, topobjdir, dist, group=Grouping.NO,
abspaths=False):
topsrcdir = mozpath.normsep(os.path.normcase(os.path.abspath(topsrcdir)))
topobjdir = mozpath.normsep(os.path.normcase(os.path.abspath(topobjdir)))
dist = mozpath.normsep(os.path.normcase(os.path.abspath(dist)))
if abspaths:
topsrcdir_value = topsrcdir
topobjdir_value = topobjdir
dist_value = dist
else:
topsrcdir_value = '$(topsrcdir)'
topobjdir_value = '$(DEPTH)'
dist_value = '$(DIST)'
self._normpaths = {
topsrcdir: topsrcdir_value,
topobjdir: topobjdir_value,
dist: dist_value,
'$(topsrcdir)': topsrcdir_value,
'$(DEPTH)': topobjdir_value,
'$(DIST)': dist_value,
'$(depth)': topobjdir_value, # normcase may lowercase variable refs when
'$(dist)': dist_value, # they are in the original dependency file
mozpath.relpath(topobjdir, os.curdir): topobjdir_value,
mozpath.relpath(dist, os.curdir): dist_value,
}
try:
# mozpath.relpath(topsrcdir, os.curdir) fails when source directory
# and object directory are not on the same drive on Windows. In
# this case, the value is not useful in self._normpaths anyways.
self._normpaths[mozpath.relpath(topsrcdir, os.curdir)] = topsrcdir_value
except ValueError:
pass
Makefile.__init__(self)
self._group = group
self._targets = OrderedDict()