从鸡蛋中提取ctag用于发育。
z3c.recipe.tag的Python项目详细描述
z3c.recipe.tag
内容
-
z3c.recipe.tag
- 简介
- 依赖关系
- 如何使用该配方
- 使用buildout
- 使用virtualenv时
- 用摊铺机进行摊铺
- 附加资源
- 0.8(2014-10-20)
- 0.7(2013-03-22)
- 0.6(2012-09-07)
- 0.5(2012-09-06)
- 0.4.1(2012-01-11)
- 0.4.0(2010-08-29)
- 0.3.0(2009-08-16)
- 0.2.0(2008-08-28)
- 0.1.0(2008-03-16)
简介
此配方生成一个标记数据库文件,可与 快速查找类和函数的不同编辑器的数目 包的源文件和egg依赖项中的定义。
依赖关系
在运行启用标记的构建之前,必须安装 适当的命令行标记生成工具:强大的ctag和 ID使用。在ubuntu中,您可以使用apt-get:
$ sudo apt-get install exuberant-ctags id-utils
在Mac上,从http://www.macports.org/" rel="nofollow">http://www.macports.org/下载并安装 端口 ,然后 以这种方式安装ctag和idutils:
$ sudo port install ctags idutils
如何使用此配方
带构建
假设您有一个名为 myapplication 的egg。使用这个配方 buildout,您可以在 buildout.cfg 文件中添加以下内容:
[tags] recipe = z3c.recipe.tag eggs = MyApplication
这将在 bin/ 目录中生成一个脚本文件,您可以 然后这样跑:
$ ./bin/tags
默认情况下,此脚本在目录中从 你运行的脚本:
- 一个名为 标记的ctags文件,供emacs使用,
- 一个名为 tags 的ctags文件,供vi使用,并且
- 一个名为 id 的id utils文件,供id utils(gid,lid)使用。
然后,您可以在您选择的编辑器中使用这些文件。
也可以选择要生成的文件。以下是输出 关于 /bin/tags --帮助
usage: build_tags [options] options: -h, --help show this help message and exit -l LANGUAGES, --languages=LANGUAGES ctags comma-separated list of languages. defaults to ``-JavaScript`` -e, --ctags-emacs flag to build emacs ctags ``TAGS`` file -v, --ctags-vi flag to build vi ctags ``tags`` file -b, --ctags-bbedit flag to build bbedit ctags ``tags`` file -i, --idutils flag to build idutils ``ID`` file
如果您希望在默认情况下设置命令行选项(例如限制 在默认情况下构建到ctags vi)您可以将 default 选项传入 你的buildout.cfg:
[tags] recipe = z3c.recipe.tag eggs = MyApplication default = ['-v']
您可以将其与 virtualenv 也:
my_venv/bin/pip install z3c.recipe.tag my_venv/bin/build_tags
这将为该virtualenv中安装的所有软件包生成一个标记文件。
使用摊铺机
如果您使用的是 摊铺机 ,并且已经 已安装z3c.recipe.tag,则只需将此行添加到 你的 人行道.py 文件:
import z3c.recipe.tag
然后从命令行运行 z3c.recipe.tag.tags任务:
$ paver z3c.recipe.tag.tags
其他资源
有关在不同编辑器中使用标记表的其他信息 请访问以下网站:
-
emacs
:http://www.gnu.org/software/emacs/manual/html嫒node/emacs/tags.html" rel="nofollow">http://www.gnu.org/software/emacs/manual/html嫒node/emacs/tags.html
- 要跳转到标记的位置,请键入 m-x 查找标记 标记的名称。或者使用m-. 跳转到与令牌匹配的标记 光标当前处于打开状态。你第一次这样做,你会 提示输入标记文件的位置。
- vim :http://vimdoc.sourceforge.net/htmldoc/tagsrch.html" rel="nofollow">http://vimdoc.sourceforge.net/htmldoc/tagsrch.html
- bbedit :http://pine.barebones.com/manual/bbedit_9_user_manual.pdf" rel="nofollow">http://pine.barebones.com/manual/bbedit_9_user_manual.pdf 第14章,第324页
有关CTAG的更多信息,请访问http://ctags.sourceforge.net/" rel="nofollow">http://ctags.sourceforge.net/
( bbedit 是一个Macintosh文本编辑器。)
有关gnu id utils的更多信息(基本上是本地文本 索引/搜索引擎;把它看作是grep的一个非常快速的版本 -w ,请参见 id utils手册