跳转到主要内容

用于在svn仓库中查找标签和分支的库

项目描述

tha.tagfinder

tha.tagfinder 是一个用于在svn层次结构中查找分支和标签的库。包括不进入特定目录等选项。

Reinout van ReesThe Health Agency 制作。

更多详细信息请参阅 src/tha/tagfinder/USAGE.txt。

tha.tagfinder 的使用方法

tha.tagfinder 的目标是遍历svn结构并返回标签和分支。

需要三个导入

>>> from tha.tagfinder import extracter
>>> from tha.tagfinder import finder
>>> from tha.tagfinder import lister

您需要一个起点,它可以是svn url或目录名。我们的测试用例提供了一个svn仓库

>>> repo_url
'file://.../repo'

将您的起点提供给一个列表器,在本例中是一个 SvnLister,可选地提供一个要忽略的目录名列表

>>> startpoint = lister.SvnLister(repo_url, ignore=['sandbox'])

选择一个提取器。通常是 BaseExtracter,但您可以对其进行子类化

>>> info_extracter = extracter.BaseExtracter

最后,设置一个带有起点和提取器的查找器。可选地传递 stop_indicators,当在目录中找到时,将停止查找器在该目录中递归

>>> info = finder.Finder(startpoint, info_extracter,
...                      stop_indicators=[])

主要用法是查询此信息对象以获取它找到的项目

>>> print(info.projects)
[<tha.tagfinder.extracter.BaseExtracter object at ...,
 <tha.tagfinder.extracter.BaseExtracter object at ...]

每个项目对象都有由提取器提供的属性。因此,如果您需要自己的额外属性,请对提取器进行子类化

>>> project = info.projects[1]
>>> project.name
'project1'
>>> project.location
'file://.../repo/project1'
>>> project.tags
['0.1', '0.2', '0.3-bugfix']
>>> project.tag_location('0.2')
'file://.../repo/project1/tags/0.2'

待办事项

  • 目前没有。

tha.tagfinder 的更改日志

1.2 (2009-12-18)

  • 尚未更改。

1.1 (2009-12-18)

  • 已更新测试设置以使用compattest。[reinout]

  • 文档清理。[reinout]

1.0 (2009-10-06)

  • 在从svn检出运行测试时与从发布egg运行测试时处理差异。[reinout]

0.4 (2009-10-06)

  • 修复了test-all设置。[reinout]

  • 在测试工具中的空目录中添加了小文件,以防止它们在egg中被省略。[reinout]

0.3 (2009-10-05)

  • 通过移除一些内部健康机构开发工具为pypi发布做准备。[reinout]

0.2 (2009-10-05)

  • 在USAGE.txt中更新了带有基本示例的文档。[reinout]

0.1 (2009-10-05)

  • 复制了大部分原始tha.taglist代码,但进行了清理和测试。[reinout]

  • 由thaskel创建了初始库骨架。[reinout]

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

tha.tagfinder-1.2.tar.gz (13.4 kB 查看散列)

上传时间

支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面