forked from trac-hacks/trac-code-comments-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
265 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
from code_comments import comment | ||
from code_comments import comment_macro | ||
from code_comments import comments | ||
from code_comments import db | ||
from code_comments import notification | ||
from code_comments import subscription | ||
from code_comments import ticket_event_listener | ||
from code_comments import web | ||
import pkg_resources | ||
pkg_resources.require('Trac >= 1.2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from trac.core import Component, ExtensionPoint, Interface | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from code_comments.comments import Comments | ||
from genshi.builder import tag | ||
from trac.wiki.macros import WikiMacroBase | ||
|
||
|
||
class CodeCommentLinkMacro(WikiMacroBase): | ||
"""CodeCommentLink macro. | ||
This macro is used to embed a comment link in a ticket or wiki page: | ||
[[CodeCommentLink(5)]] | ||
where the number in the parentheses is the comment ID. | ||
""" | ||
|
||
revision = "$Rev$" | ||
url = "$URL$" | ||
re = r'\[\[CodeCommentLink\((\d+)\)\]\]' | ||
|
||
def expand_macro(self, formatter, name, text, args): | ||
try: | ||
comment = Comments(formatter.req, formatter.env).by_id(text) | ||
return tag.a(comment.link_text(), href=comment.href()) | ||
except: | ||
return '' | ||
return '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.