本文整理汇总了Python中twitter.common.dirutil.fileset.Fileset.globs方法的典型用法代码示例。如果您正苦于以下问题:Python Fileset.globs方法的具体用法?Python Fileset.globs怎么用?Python Fileset.globs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.common.dirutil.fileset.Fileset
的用法示例。
在下文中一共展示了Fileset.globs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twitter.common.dirutil.fileset import Fileset [as 别名]
# 或者: from twitter.common.dirutil.fileset.Fileset import globs [as 别名]
def __init__(self, address=None, payload=None, **kwargs):
# TODO(John Sirois): Make pants.backend.core.wrapped_globs.Globs in the core backend
# constructable with just a rel_path. Right now it violates the Law of Demeter and
# fundamentally takes a ParseContext, which it doesn't actually need and which other backend
# consumers should not need to know about or create.
# Here we depend on twitter/commons which is less than ideal in core pants and even worse in a
# plugin. We depend on it here to ensure the globbing is lazy and skipped if the target is
# never fingerprinted (eg: when running `./pants list`).
sources = Fileset.globs('*.go', root=os.path.join(get_buildroot(), address.spec_path))
payload = payload or Payload()
payload.add_fields({
'sources': self.create_sources_field(sources=sources,
sources_rel_path=address.spec_path,
key_arg='sources'),
})
super(GoLocalSource, self).__init__(address=address, payload=payload, **kwargs)