<分区>
在哪里可以找到有关使用 subversion python 绑定(bind)的很好的介绍?
我找到了 one section in the svnbook谈论它;还有一些basic examples from 1.3 .
有没有更彻底和最新的东西?
<分区>
在哪里可以找到有关使用 subversion python 绑定(bind)的很好的介绍?
我找到了 one section in the svnbook谈论它;还有一些basic examples from 1.3 .
有没有更彻底和最新的东西?
最佳答案
只是想在这里添加一点说明。
多亏了以上两个答案(@BenjaminWohlwend 和 @Logan),我才意识到 Subversion 有不止一套 Python 绑定(bind)/接口(interface);我在我的 Ubuntu 11.04 机器上做了这个:
$ apt-cache search '[Ss]vn|[Ss]ubversion' | grep -i python
python-svn - A(nother) Python interface to Subversion
python-svn-dbg - A(nother) Python interface to Subversion (debug extension)
python-subversion - Python bindings for Subversion
python-subversion-dbg - Python bindings for Subversion (debug extension)
python-opster - a python command line parsing speedster
python-py - Advanced Python testing tool and networking lib
python-rope - Python refactoring library
python-subvertpy - Alternative Python bindings for Subversion
可以查看 Debian 软件包文件列表,以确定它们引用了哪些库;所以我们有:
python-subversion
- 或 SWIG 绑定(bind)(或 libsvn
、libsvn_swig_py
)filelist
导入 svn.core, svn.client
; from svn import fs, core, repos
python-svn
- 或 pysvn
filelist
python-subvertpy
- 或 subvertpy
filelist
from subvertpy import delta, repos
, from subvertpy.ra import RemoteAccess, Auth
...我还在存储库中找到了另一个:
ctypes-python
- 或 csvn
source
import csvn.core
, from csvn.repos import *
链接http://svn.apache.org/repos/asf/subversion (我从 @BenjaminWohlwend 得到的)显然是 Apache Software Foundation (asf?) Subversion 源代码本身的 Subversion 存储库。
OP 对文档的追求似乎与 python-subversion
(或 SWIG 绑定(bind)(或 libsvn
))有关;其源代码构建说明在 @Logan 中我在 OP 中已经提到的 svn.developer: Using the APIs 找不到更好的文档来源,除了 bindings/swig/python/README ;它解释了 SWIG 如何从 C 生成 Python 接口(interface):
TRANSLATING PARAMETER LISTS
The argument-reductions laws of the SWIG bindings something go like
this:- The module prefix can be omitted. o: void *some_C_function = svn_client_foo; becomes: import svn.client func = svn.client.foo
[...]
然后,可以查看,比如说,svn/core.py , 并找到像 svn_mergeinfo_merge
这样的函数(和“明确定义的符号”);注意 core.py
导入 libsvn.core
- 其中 libsvn
可能指的是共享对象 (.so
)从 C 文件构建的文件 libsvn_swig_py/swigutil_py.c .
然后,我们可以查找svn_mergeinfo_merge
,并找到类似SVNSearch: Subversion (commit 23570 05.03.2007) 的提交信息。 ,它指的是那个函数,还有一个 svn_mergeinfo.h
;进一步查找该文件,我们在 ASF 存储库中找到它:svn_mergeinfo.h ,其中确实包含:
/** Like svn_mergeinfo_merge2, but uses only one pool.
*
* @deprecated Provided for backward compatibility with the 1.5 API.
*/
SVN_DEPRECATED
svn_error_t *
svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
svn_mergeinfo_t changes,
apr_pool_t *pool);
在那里看到DEPRECATED
,这里引用一下svn commit: r1175903 (Mon Sep 26 2011)可能也不错:
subversion/libsvn_subr/mergeinfo.c
(svn_mergeinfo_merge2): New.
(svn_mergeinfo_merge): Move to deprecated.c.
(svn_mergeinfo_catalog_merge): Use the new API.
也就是说 - 该特定功能已在 2011 年弃用 - 所以希望一个人的 Python SVN 绑定(bind)和 SVN 安装应该匹配......
关于python - 颠覆 python 绑定(bind)文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1448894/