本文整理匯總了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()