如何在Trac中快速添加门票?

发布于 2024-07-06 12:52:26 字数 1560 浏览 7 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

对风讲故事 2024-07-13 12:52:26

下面允许您键入快速注释。 该注释将成为分配给您自己的 Trac 票证。 我用它来处理非常快速的错误和/或我不想忘记的功能。 或者,如果我编写了一个功能,我会打开然后关闭它的票证,这样我就可以获得全额积分:)
- j

#!/usr/bin/env python

'''
trac-bug: add bug/feature to current Trac project, from the command line.
Specify Trac project directory in TRAC_ENV environment variable.
'''


import os, sys

TRAC_ENV = os.environ.get('TRAC_ENV') or os.path.expanduser('~/trac/projectenv')
if not os.path.isdir(TRAC_ENV):
    print >>sys.stderr, "Set TRAC_ENV to the Trac project directory."
    sys.exit(2)

from trac.env import open_environment
from trac.ticket import Ticket
t = Ticket(open_environment(TRAC_ENV))

desc = ' '.join(sys.argv[1:])
info = dict(
    status='open', 
    owner=os.environ['USER'], reporter=os.environ['USER'],
    description = desc, summary=desc
)

t.populate(info)
num = t.insert()
if not num:
    print >>sys.stderr, "Ticket not created"
    print >>sys.stder, vals
    sys.exit(1)

print "Ticket #%d: %s" % (num,desc)
sys.exit(0)                 # all is well

用法很简单:

$ trac-bug out of beer

Ticket #9: out of beer

The following allows you to type a quick note. The note becomes a Trac ticket, assigned to yourself. I use this for very quick bugs and/or features I don't want to forget. Or, if I make up a feature I open then close a ticket for it, so I get full credit :)
- j

#!/usr/bin/env python

'''
trac-bug: add bug/feature to current Trac project, from the command line.
Specify Trac project directory in TRAC_ENV environment variable.
'''


import os, sys

TRAC_ENV = os.environ.get('TRAC_ENV') or os.path.expanduser('~/trac/projectenv')
if not os.path.isdir(TRAC_ENV):
    print >>sys.stderr, "Set TRAC_ENV to the Trac project directory."
    sys.exit(2)

from trac.env import open_environment
from trac.ticket import Ticket
t = Ticket(open_environment(TRAC_ENV))

desc = ' '.join(sys.argv[1:])
info = dict(
    status='open', 
    owner=os.environ['USER'], reporter=os.environ['USER'],
    description = desc, summary=desc
)

t.populate(info)
num = t.insert()
if not num:
    print >>sys.stderr, "Ticket not created"
    print >>sys.stder, vals
    sys.exit(1)

print "Ticket #%d: %s" % (num,desc)
sys.exit(0)                 # all is well

Usage is brief:

$ trac-bug out of beer

Ticket #9: out of beer

情泪▽动烟 2024-07-13 12:52:26

如果您使用 Eclipse:Mylyn 是完美的。

否则您总是可以获得 XML RPC 插件。 http://trac-hacks.org/wiki/XmlRpcPlugin 并推出您自己的小工具。

为了快速创建类似的票证,您可以使用克隆插件:http://trac-hacks.org/wiki/ CloneTicketPlugin

编辑 我通过 SVN 支持 Espen 的想法 签入挂钩,它对我们也很有用。

If you're using Eclipse: Mylyn is perfect.

Otherwise you could always get the XML RPC plugin. http://trac-hacks.org/wiki/XmlRpcPlugin and roll your own little tool.

For quickly creating similar tickets, you could use the Clone plugin: http://trac-hacks.org/wiki/CloneTicketPlugin

Edit And I second Espen's idea with the SVN checkin hook, it works great for us, as well.

淡墨 2024-07-13 12:52:26

您可以尝试使用 EmailtoTrack,这样您只需发送电子邮件即可创建票证。

(另一个巧妙的跟踪技巧,如果与您的问题没有直接关系,就是在版本控制系统中使用提交挂钩,这样您就可以通过提交来关闭票证。我只尝试过 这个 用于 SVN,但移植起来应该不难。)

You could try using EmailtoTrack, so you can create tickets just by sending emails.

(Another neat track tip, if not directly related to your question, is to use a commit hook with your version control system so you can close tickets by doing commits. I've only tried this one for SVN, but it shouldn't be hard to port.)

尘曦 2024-07-13 12:52:26

track-hacks 上还有一个命令行 trac 票证创建器,您必须在 trac 存储库所在的同一台计算机上运行它。 我发现命令行添加比基于网络的添加要快得多。

http://trac-hacks.org/wiki/TicketToTracScript

There is also a command-line trac ticket creator on track-hacks, you have to run it on the same machine as the trac repo resides. I find the command line addition to be much faster than the web-based one.

http://trac-hacks.org/wiki/TicketToTracScript

脱离于你 2024-07-13 12:52:26

与此同时,一个编程的 TicketImportPlugin 可以在 Excel 表的一次用户交互中创建或更新多个票证。

Meanwhile one programmed TicketImportPlugin which creates or updates multiple tickets in one user interaction from Excel table.

雨轻弹 2024-07-13 12:52:26

如果 Mylyn 适合您,也请考虑查看 http://tasktop.com。 Tasktop 通过自动时间跟踪、网页浏览支持、电子邮件和日历集成等强大的生产力功能扩展了 Mylyn。

If Mylyn is working for you, consider checking out http://tasktop.com too. Tasktop extends Mylyn with powerful productivity features such as automatic time tracking, web browsing support, email and calendar integration, and more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文