#8800 closed defect (fixed)
Support Trac 0.12 without ClearSilver
Reported by: | Bangyou Zheng | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | PeerReviewPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description (last modified by )
This plugin is wonderful. But It can not support Trac 0.12 without ClearSilver.
Current is there any plan to support Trac 0.12?
Thank you very much!
Attachments (1)
Change History (10)
comment:1 Changed 14 years ago by
Trac Release: | 0.11 → 0.12 |
---|
comment:2 Changed 14 years ago by
comment:3 follow-up: 6 Changed 14 years ago by
I was able to get this plugin to work from the 2.2-dev branch with the attached diff file (peerreviewplugin_dev2_2_diff_Trac_0_12_2.diff). I hacked this together because I really liked this plugin, and I needed it to work in Trac 0.12.2.
It still isn't perfect, it doesn't handle multiple repositories properly (it will only see the first repo in your repository list), but it does what we need it to do. There are also some issues with the Genshi templates and trying to import other templates - so I just copied the functions into the template I needed (not good for maintainability).
Changed 14 years ago by
Attachment: | peerreviewplugin_dev2_2_diff_Trac_0_12_2.diff added |
---|
diff for fixing peer review plugin for trac 0.12.2
comment:4 Changed 13 years ago by
I got it to work on Fedora 16. Not professional. I have no Python experience, but it works. Note that I also had to get a clearsilver 'error.cs' file and put it at '/usr/lib/python2.7/site-packages/trac/templates/error.cs'.
Here is the code changes,
-
peerReviewPerform.py
[hzqmrk@gazoo codereview]$ svn diff
30 30 import string 31 31 32 32 from genshi.builder import tag 33 from trac.versioncontrol.api import RepositoryManager 33 34 34 35 class UserbaseModule(Component): 35 36 implements(INavigationContributor, IRequestHandler, ITemplateProvider, IHTMLPreviewAnnotator) … … 140 141 return 'error.cs', None 141 142 142 143 #get the respository 143 repos = self.env.get_repository(req.authname) 144 #repos = self.env.get_repository(req.authname) 145 repos = RepositoryManager(self.env).get_repository('') 144 146 #get the file attributes 145 147 req.hdf['review.path'] = resultFile.Path 146 148 req.hdf['review.version'] = resultFile.Version -
peerReviewBrowser.py
22 22 from trac.web.chrome import add_link, add_stylesheet 23 23 from trac.wiki import wiki_to_html, wiki_to_oneliner, IWikiSyntaxProvider 24 24 from trac.versioncontrol.web_ui.util import * 25 from trac.versioncontrol.api import RepositoryManager 25 26 26 27 from genshi.builder import tag 27 28 … … 84 85 path = req.args.get('path', '/') 85 86 rev = req.args.get('rev') 86 87 87 repos = self.env.get_repository(req.authname)88 repos = RepositoryManager(self.env).get_repository('') 88 89 89 90 try: 90 91 node = get_existing_node(self.env, repos, path, rev) 91 92 except: 92 rev = repos. youngest_rev93 rev = repos.get_youngest_rev() 93 94 node = get_existing_node(self.env, repos, path, rev) 94 95 95 96 hidden_properties = [p.strip() for p … … 98 99 req.hdf['title'] = path 99 100 req.hdf['browser'] = { 100 101 'path': path, 101 'revision': rev or repos. youngest_rev,102 'revision': rev or repos.get_youngest_rev(), 102 103 'props': dict([(util.escape(name), util.escape(value)) 103 104 for name, value in node.get_properties().items() 104 105 if not name in hidden_properties]), 105 106 'href': util.escape(self.env.href.peerReviewBrowser(path, rev=rev or 106 repos. youngest_rev)),107 repos.get_youngest_rev())), 107 108 'log_href': util.escape(self.env.href.log(path, rev=rev or None))
comment:5 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Owner: | changed from Sebastian Marek to Ryan J Ollos |
Summary: | Is there any progress to support Trac 0.12 without Genshi → Support Trac 0.12 without ClearSilver |
comment:6 Changed 12 years ago by
Replying to trevor.w.ratliff@gmail.com:
There are also some issues with the Genshi templates and trying to import other templates - so I just copied the functions into the template I needed (not good for maintainability).
Could you describe this problem in more detail?
comment:8 Changed 9 years ago by
comment:9 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The current trunk [15204] works for me with 0.12.3.
Genshi is a requirement for Trac 0.11 and later, see t:TracInstall#MandatoryDependencies. Do you mean that ClearSilver is still required? That should not be the case, see #3187, but it is still possible.