Merge lp:~cjwatson/loggerhead/chameleon into lp:loggerhead
- chameleon
- Merge into trunk-rich
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 528 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | lp:~cjwatson/loggerhead/chameleon |
Merge into: | lp:loggerhead |
Diff against target: |
1174 lines (+209/-216) 25 files modified
.travis.yml (+1/-3) Dockerfile (+1/-1) NEWS (+2/-0) byov.conf (+2/-3) docs/index.rst (+3/-5) loggerhead/controllers/view_ui.py (+1/-1) loggerhead/main.py (+0/-8) loggerhead/templatefunctions.py (+2/-2) loggerhead/templates/atom.pt (+6/-6) loggerhead/templates/breadcrumbs.pt (+2/-2) loggerhead/templates/changelog.pt (+22/-22) loggerhead/templates/directory.pt (+13/-13) loggerhead/templates/error.pt (+7/-7) loggerhead/templates/feed-link.pt (+1/-1) loggerhead/templates/filediff.pt (+4/-4) loggerhead/templates/inventory.pt (+31/-31) loggerhead/templates/macros.pt (+1/-1) loggerhead/templates/revision.pt (+30/-30) loggerhead/templates/revisionfilechanges.pt (+19/-19) loggerhead/templates/revisioninfo.pt (+9/-9) loggerhead/templates/revlog.pt (+1/-1) loggerhead/templates/view.pt (+17/-17) loggerhead/tests/test_controllers.py (+29/-14) loggerhead/zptsupport.py (+5/-15) requirements.txt (+0/-1) |
To merge this branch: | bzr merge lp:~cjwatson/loggerhead/chameleon |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+428043@code.launchpad.net |
Commit message
Port from SimpleTAL to Chameleon.
Description of the change
SimpleTAL is a painful dependency, because it has no download files on PyPI: the only way to depend on it properly is therefore using a direct URL reference, and as I understand it packages with such references those can't be uploaded to PyPI.
Porting to Chameleon (Zope's default TAL implementation nowadays) turns out not to be too difficult. The main work involved is because it doesn't support path expressions. It would be possible to add those using `z3c.pt`, and I considered that, but that has a significant dependency tree for packages that don't already use the Zope Toolkit, and it would have also required extra startup complexity to register `ITraversable` adapters. It's easier to convert path expressions to the equivalent Python expressions, although the process of doing so was unfortunately quite error-prone.
Preview Diff
1 | === modified file '.travis.yml' |
2 | --- .travis.yml 2021-11-15 14:40:11 +0000 |
3 | +++ .travis.yml 2022-08-08 16:37:19 +0000 |
4 | @@ -10,9 +10,7 @@ |
5 | matrix: |
6 | include: |
7 | - python: 3.5 |
8 | - env: TAL_VERSION=5.2 |
9 | - python: 3.6 |
10 | - env: TAL_VERSION=5.2 |
11 | |
12 | script: |
13 | - python -m coverage run -p -m unittest loggerhead.tests.test_suite |
14 | @@ -20,7 +18,7 @@ |
15 | install: |
16 | - sudo apt install subunit adduser libjs-jquery |
17 | - travis_retry pip install -U setuptools |
18 | - - travis_retry pip install -U pip coverage codecov flake8 testtools configobj cython testscenarios six docutils python-subunit dulwich bzr+lp:brz pygments paste http://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-$TAL_VERSION.tar.gz bleach |
19 | + - travis_retry pip install -U pip coverage codecov flake8 testtools configobj cython testscenarios six docutils python-subunit dulwich bzr+lp:brz pygments paste Chameleon bleach |
20 | |
21 | after_success: |
22 | - codecov |
23 | |
24 | === modified file 'Dockerfile' |
25 | --- Dockerfile 2021-07-17 11:02:52 +0000 |
26 | +++ Dockerfile 2022-08-08 16:37:19 +0000 |
27 | @@ -4,7 +4,7 @@ |
28 | # To use, mount something on /code |
29 | # Logs will be accessible at /logs |
30 | |
31 | -RUN apt update && apt install --no-install-recommends -y python3 python3-bleach python3-paste python3-pip python3-patiencediff python3-simpletal python3-dev build-essential python3-pastedeploy python3-dulwich python3-certifi python3-configobj && pip3 install breezy && apt clean && mkdir -p /logs |
32 | +RUN apt update && apt install --no-install-recommends -y python3 python3-bleach python3-paste python3-pip python3-patiencediff python3-chameleon python3-dev build-essential python3-pastedeploy python3-dulwich python3-certifi python3-configobj && pip3 install breezy && apt clean && mkdir -p /logs |
33 | ADD . /opt/loggerhead |
34 | ENV PYTHONPATH=/opt/loggerhead |
35 | EXPOSE 8080/tcp |
36 | |
37 | === modified file 'NEWS' |
38 | --- NEWS 2022-08-08 12:52:14 +0000 |
39 | +++ NEWS 2022-08-08 16:37:19 +0000 |
40 | @@ -16,6 +16,8 @@ |
41 | |
42 | - Avoid use of file ids - use paths instead. (Jelmer Vernooij) |
43 | |
44 | + - Port from SimpleTAL to Chameleon. (Colin Watson) |
45 | + |
46 | 1.20.0 [18Jul2021] |
47 | ------------------ |
48 | |
49 | |
50 | === modified file 'byov.conf' |
51 | --- byov.conf 2020-07-08 17:14:19 +0000 |
52 | +++ byov.conf 2022-08-08 16:37:19 +0000 |
53 | @@ -6,12 +6,11 @@ |
54 | dulwich.clone = (git clone git://jelmer.uk/dulwich ../dulwich.git) |
55 | dulwich.install = (cd ../dulwich.git && ./setup.py install --user) |
56 | dulwich3.install = (cd ../dulwich.git && python3 ./setup.py install --user) |
57 | -simpletal3.install = pip3 install http://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-5.2.tar.gz |
58 | |
59 | [loggerhead] |
60 | vm.release = xenial |
61 | brz.build_deps = gcc, debhelper, python, python-all-dev, python3-all-dev, python-configobj, python3-configobj, python-docutils, python3-docutils, python-paramiko, python3-paramiko, python-subunit, python3-subunit, python-testtools, python3-testtools, subunit, cython, cython3, python-fastimport, python-dulwich, python-six, python3-six |
62 | -loggerhead.build_deps = python-setuptools, python3-setuptools, libjs-jquery, python-docutils, python3-docutils, python-pygments, python3-pygments, python-paste, python3-paste, python-pastedeploy, python3-pastedeploy, python-simpletal, python-bleach, python3-bleach |
63 | +loggerhead.build_deps = python-setuptools, python3-setuptools, libjs-jquery, python-docutils, python3-docutils, python-pygments, python3-pygments, python-paste, python3-paste, python-pastedeploy, python3-pastedeploy, python-chameleon, python3-chameleon, python-bleach, python3-bleach |
64 | loggerhead.test_deps = python3-fixtures, python-fixtures |
65 | vm.packages = {brz.build_deps}, {loggerhead.build_deps}, {loggerhead.test_deps}, bzr, python-junitxml, python3-pip |
66 | brz.branch = (bzr branch lp:brz ../brz-trunk) |
67 | @@ -19,5 +18,5 @@ |
68 | byoci.setup.command = ({dulwich.clone} && {dulwich.install} && {brz.branch} && {brz.make}) |
69 | byoci.tests.command = bash -o pipefail -c "bzr log -l2 && (BRZ_PLUGINS_AT=loggerhead@`pwd` BRZ_PLUGIN_PATH=-site:-user python2 ../brz-trunk/brz selftest -v --parallel=fork --subunit2 | subunit2junitxml -o ../results.xml -f | subunit2pyunit)" |
70 | [loggerhead-py3] |
71 | -byoci.setup.command = ({dulwich.clone} && {dulwich3.install} && {brz.branch} && {brz.make} && {simpletal3.install}) |
72 | +byoci.setup.command = ({dulwich.clone} && {dulwich3.install} && {brz.branch} && {brz.make}) |
73 | byoci.tests.command = bash -o pipefail -c "bzr log -l2 && (BRZ_PLUGINS_AT=loggerhead@`pwd` BRZ_PLUGIN_PATH=-site:-user python3 ../brz-trunk/brz selftest -v --parallel=fork --subunit2 | subunit2junitxml -o ../results.xml -f | subunit2pyunit)" |
74 | |
75 | === modified file 'docs/index.rst' |
76 | --- docs/index.rst 2020-07-08 17:14:19 +0000 |
77 | +++ docs/index.rst 2022-08-08 16:37:19 +0000 |
78 | @@ -13,7 +13,7 @@ |
79 | |
80 | Loggerhead depends on the following Python libraries.: |
81 | |
82 | -- SimpleTAL for templating. |
83 | +- Chameleon for templating. |
84 | |
85 | - Paste for the server. (You need version 1.2 or newer of Paste). |
86 | |
87 | @@ -27,7 +27,7 @@ |
88 | |
89 | .. code-block:: sh |
90 | |
91 | - $ sudo apt-get install python-simpletal |
92 | + $ sudo apt-get install python-chameleon |
93 | $ sudo apt-get install python-paste |
94 | $ sudo apt-get install python-pastedeploy |
95 | $ sudo apt-get install python-flup |
96 | @@ -37,9 +37,7 @@ |
97 | |
98 | .. code-block:: sh |
99 | |
100 | - $ easy_install \ |
101 | - -f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \ |
102 | - SimpleTAL |
103 | + $ easy_install Chameleon |
104 | $ easy_install Paste |
105 | $ easy_install PasteDeploy |
106 | $ easy_install flup |
107 | |
108 | === modified file 'loggerhead/controllers/view_ui.py' |
109 | --- loggerhead/controllers/view_ui.py 2022-07-06 12:45:28 +0000 |
110 | +++ loggerhead/controllers/view_ui.py 2022-08-08 16:37:19 +0000 |
111 | @@ -82,7 +82,7 @@ |
112 | extra_lines = len(file_lines) - len(hl_lines) |
113 | hl_lines.extend([u''] * extra_lines) |
114 | else: |
115 | - hl_lines = map(util.html_escape, file_lines) |
116 | + hl_lines = [util.html_escape(line) for line in file_lines] |
117 | |
118 | return hl_lines |
119 | |
120 | |
121 | === modified file 'loggerhead/main.py' |
122 | --- loggerhead/main.py 2021-11-15 14:40:11 +0000 |
123 | +++ loggerhead/main.py 2022-08-08 16:37:19 +0000 |
124 | @@ -84,14 +84,6 @@ |
125 | # if it is configured to suppress it |
126 | handler.setLevel(logging.DEBUG) |
127 | logger.addHandler(handler) |
128 | - def _restrict_logging(logger_name): |
129 | - logger = logging.getLogger(logger_name) |
130 | - if logger.getEffectiveLevel() < logging.INFO: |
131 | - logger.setLevel(logging.INFO) |
132 | - # simpleTAL is *very* verbose in DEBUG mode, which is otherwise the |
133 | - # default. So quiet it up a bit. |
134 | - _restrict_logging('simpleTAL') |
135 | - _restrict_logging('simpleTALES') |
136 | return logger |
137 | |
138 | |
139 | |
140 | === modified file 'loggerhead/templatefunctions.py' |
141 | --- loggerhead/templatefunctions.py 2020-07-08 17:14:19 +0000 |
142 | +++ loggerhead/templatefunctions.py 2022-08-08 16:37:19 +0000 |
143 | @@ -180,8 +180,8 @@ |
144 | else: |
145 | versions.append(('PasteDeploy', PasteDeploy.version)) |
146 | |
147 | - import simpletal |
148 | - versions.append(('SimpleTAL', simpletal.__version__)) |
149 | + Chameleon = pkg_resources.get_distribution('Chameleon') |
150 | + versions.append(('Chameleon', Chameleon.version)) |
151 | |
152 | try: |
153 | import pygments |
154 | |
155 | === modified file 'loggerhead/templates/atom.pt' |
156 | --- loggerhead/templates/atom.pt 2010-05-05 18:42:58 +0000 |
157 | +++ loggerhead/templates/atom.pt 2022-08-08 16:37:19 +0000 |
158 | @@ -1,7 +1,7 @@ |
159 | <?xml version="1.0" encoding="utf-8"?> |
160 | <feed xmlns="http://www.w3.org/2005/Atom" xmlns:tal="http://xml.zope.org/namespaces/tal"> |
161 | <title> |
162 | - bazaar changes for <tal:branch-name content="branch/friendly_name">branch name</tal:branch-name> |
163 | + bazaar changes for <tal:branch-name content="branch.friendly_name">branch name</tal:branch-name> |
164 | </title> |
165 | <updated tal:content="string:${updated}Z">${updated}</updated> |
166 | <id tal:content="python:branch.absolute_url(['/atom'])">url</id> |
167 | @@ -9,22 +9,22 @@ |
168 | <link rel="alternate" type="text/html" tal:attributes="href python:branch.url(['/changes'])" /> |
169 | |
170 | <entry tal:repeat="entry changes"> |
171 | - <title tal:content="string:${entry/revno}: ${entry/short_comment}"> |
172 | - ${entry/revno}: ${entry/short_comment} |
173 | + <title tal:content="string:${entry.revno}: ${entry.short_comment}"> |
174 | + ${entry.revno}: ${entry.short_comment} |
175 | </title> |
176 | - <updated tal:content="string:${entry/utc_date/isoformat}Z"> |
177 | + <updated tal:content="string:${entry.utc_date.isoformat}Z"> |
178 | updated |
179 | </updated> |
180 | <!-- TODO: The feed validator will generate warnings because this is URL-encoded --> |
181 | <id tal:content="python:branch.absolute_url(['/revision', entry.revno])"> |
182 | ID |
183 | </id> |
184 | - <author tal:repeat="author entry/authors"> |
185 | + <author tal:repeat="author entry.authors"> |
186 | <name tal:content="python:util.hide_email(author)"> |
187 | author |
188 | </name> |
189 | </author> |
190 | - <content type="text" tal:content="entry/comment"> |
191 | + <content type="text" tal:content="entry.comment"> |
192 | comment |
193 | </content> |
194 | <link rel="alternate" type="text/html" |
195 | |
196 | === modified file 'loggerhead/templates/breadcrumbs.pt' |
197 | --- loggerhead/templates/breadcrumbs.pt 2012-01-08 21:43:42 +0000 |
198 | +++ loggerhead/templates/breadcrumbs.pt 2022-08-08 16:37:19 +0000 |
199 | @@ -10,12 +10,12 @@ |
200 | |
201 | <!-- Branch breadcrumbs (for the path within the branch) --> |
202 | <span metal:define-macro="branch" class="breadcrumb"> |
203 | - <tal:block repeat="crumb branch_breadcrumbs">/<a tal:attributes="href python:url([crumb['suffix'], change.revno, crumb['path']])" tal:content="crumb/dir_name" tal:condition="not:repeat/crumb/end" /><span tal:replace="crumb/dir_name" tal:condition="repeat/crumb/end" /></tal:block> |
204 | + <tal:block repeat="crumb branch_breadcrumbs">/<a tal:attributes="href python:url([crumb['suffix'], change.revno, crumb['path']])" tal:content="crumb.dir_name" tal:condition="not:repeat.crumb.end" /><span tal:replace="crumb.dir_name" tal:condition="repeat.crumb.end" /></tal:block> |
205 | </span> |
206 | |
207 | <!-- Directory breadcrumbs (for the path leading up to the branch) --> |
208 | <span metal:define-macro="directory" class="breadcrumb"> |
209 | - <tal:block repeat="crumb directory_breadcrumbs"><span tal:condition="not:repeat/crumb/start">/</span><a tal:attributes="href python:static_url('/'+crumb['path'])" tal:content="crumb/dir_name" /></tal:block> |
210 | + <tal:block repeat="crumb directory_breadcrumbs"><span tal:condition="not:repeat.crumb.start">/</span><a tal:attributes="href python:static_url('/'+crumb['path'])" tal:content="crumb.dir_name" /></tal:block> |
211 | </span> |
212 | |
213 | </body> |
214 | |
215 | === modified file 'loggerhead/templates/changelog.pt' |
216 | --- loggerhead/templates/changelog.pt 2022-07-06 12:45:28 +0000 |
217 | +++ loggerhead/templates/changelog.pt 2022-08-08 16:37:19 +0000 |
218 | @@ -1,12 +1,12 @@ |
219 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
220 | -<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main"> |
221 | +<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros.main"> |
222 | <head> |
223 | <title metal:fill-slot="title" |
224 | - tal:content="string:${branch/friendly_name} : changes"></title> |
225 | + tal:content="string:${branch.friendly_name} : changes"></title> |
226 | <metal:block fill-slot="header_extras"> |
227 | <link rel="alternate" type="application/atom+xml" |
228 | tal:attributes="href python:url(['/atom']); |
229 | - title string:RSS feed for ${branch/friendly_name}" /> |
230 | + title string:RSS feed for ${branch.friendly_name}" /> |
231 | <script type="text/javascript"> |
232 | var revids = <tal:block content="data" />; |
233 | </script> |
234 | @@ -17,25 +17,25 @@ |
235 | |
236 | <body> |
237 | <tal:block metal:fill-slot="backlink"> |
238 | - <tal:has-link condition="branch/branch_link"> |
239 | + <tal:has-link condition="branch.branch_link"> |
240 | <div class="black-link"> |
241 | - <a tal:attributes="href branch/branch_link"> |
242 | + <a tal:attributes="href branch.branch_link"> |
243 | ← Back to branch summary |
244 | </a> |
245 | </div> |
246 | </tal:has-link> |
247 | </tal:block> |
248 | - <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" /> |
249 | + <tal:block metal:fill-slot="branchname" tal:content="branch.friendly_name" /> |
250 | <tal:block metal:fill-slot="heading"> |
251 | <div id="breadcrumbs"> |
252 | - <tal:has-link condition="branch/branch_link"> |
253 | - <a tal:attributes="href branch/branch_link" |
254 | - tal:content="branch/friendly_name"> |
255 | + <tal:has-link condition="branch.branch_link"> |
256 | + <a tal:attributes="href branch.branch_link" |
257 | + tal:content="branch.friendly_name"> |
258 | nice/branch/name |
259 | </a> |
260 | </tal:has-link> |
261 | - <tal:no-link condition="not: branch/branch_link"> |
262 | - <span metal:use-macro="breadcrumbs/directory"></span> |
263 | + <tal:no-link condition="not: branch.branch_link"> |
264 | + <span metal:use-macro="breadcrumbs.directory"></span> |
265 | </tal:no-link> |
266 | <tal:block condition="changes"> |
267 | » Changes |
268 | @@ -60,11 +60,11 @@ |
269 | No revisions! |
270 | </p> |
271 | |
272 | - <p class="fr revnolink">From Revision <a tal:attributes="href # |
273 | + <p class="fr revnolink">From Revision <a tal:attributes="href string:# |
274 | title python:'Show revision '+history.get_revno(revid)" |
275 | tal:content="python:history.get_revno(revid)"></a> |
276 | <tal:block tal:condition="python:navigation.last_in_page_revid is not None"> to |
277 | - <a tal:attributes="href # |
278 | + <a tal:attributes="href string:# |
279 | title 'Show revision '+history.get_revno(navigation.last_in_page_revid)" |
280 | tal:content="python:history.get_revno(navigation.last_in_page_revid)"></a> |
281 | </tal:block></p> |
282 | @@ -89,8 +89,8 @@ |
283 | <th class="downloadcell">Files</th> |
284 | </tr> |
285 | <tal:block tal:repeat="entry changes"> |
286 | - <a tal:attributes="name string:entry-${entry/revno}"/> |
287 | - <tr tal:attributes="class string:blueRow${entry/parity} revision_log; id string:log-${entry/index}"> |
288 | + <a tal:attributes="name string:entry-${entry.revno}"/> |
289 | + <tr tal:attributes="class string:blueRow${entry.parity} revision_log; id string:log-${entry.index}"> |
290 | <td class="revnro revnolink"><a tal:attributes="title python:'Show revision '+entry.revno; |
291 | href python:url(['/revision', entry.revno], clear=1)" |
292 | tal:content="python:util.trunc(entry.revno)"></a> |
293 | @@ -110,7 +110,7 @@ |
294 | <a tal:attributes="title python:'Show revision '+entry.revno; |
295 | href python:url(['/revision', entry.revno], clear=1); |
296 | class string:link" |
297 | - tal:content="entry/short_comment"></a> |
298 | + tal:content="entry.short_comment"></a> |
299 | </div> |
300 | <div class="long_description" style="display: none"> |
301 | <img tal:condition="python:entry.parents[1:]" |
302 | @@ -126,7 +126,7 @@ |
303 | </td> |
304 | <td tal:content="python:util.trunc(util.hide_email(entry.authors[0]), 20)" |
305 | class="autcell"></td> |
306 | - <td tal:condition="show_tag_col" tal:content="string:${entry/tags}" |
307 | + <td tal:condition="show_tag_col" tal:content="string:${entry.tags}" |
308 | class="tagcell"></td> |
309 | <td class="date"> |
310 | <span tal:attributes="title python:util.date_time(entry.utc_date)" |
311 | @@ -136,7 +136,7 @@ |
312 | href python:url(['/revision', entry.revno], clear=1)"> |
313 | <img tal:attributes="src python:branch.static_url('/static/images/ico_diff.gif')" alt="Diff" /></a></td> |
314 | <td class="downr"><a tal:attributes="href python:branch.url(['/files', entry.revno]); |
315 | - title string:Files at revision ${entry/revno}"> |
316 | + title string:Files at revision ${entry.revno}"> |
317 | <img tal:attributes="src python:branch.static_url('/static/images/ico_file.gif')" alt="Files" /></a> |
318 | </td> |
319 | </tr> |
320 | @@ -145,9 +145,9 @@ |
321 | |
322 | <ul tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid" |
323 | id="pages"> |
324 | - <li tal:condition="navigation/prev_page_revid" |
325 | + <li tal:condition="navigation.prev_page_revid" |
326 | class="previous"> |
327 | - <a tal:attributes="href navigation/prev_page_url">« Newer</a> |
328 | + <a tal:attributes="href navigation.prev_page_url">« Newer</a> |
329 | </li> |
330 | <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them, |
331 | so some magic has to be done to just show the previous and next N page numbers |
332 | @@ -157,9 +157,9 @@ |
333 | <li><a href="#" |
334 | tal:content="page_number"></a></li> |
335 | </tal:block>--> |
336 | - <li tal:condition="navigation/next_page_revid" |
337 | + <li tal:condition="navigation.next_page_revid" |
338 | class="next"> |
339 | - <a tal:attributes="href navigation/next_page_url">Older »</a> |
340 | + <a tal:attributes="href navigation.next_page_url">Older »</a> |
341 | </li> |
342 | </ul> |
343 | |
344 | |
345 | === modified file 'loggerhead/templates/directory.pt' |
346 | --- loggerhead/templates/directory.pt 2018-09-08 17:34:27 +0000 |
347 | +++ loggerhead/templates/directory.pt 2022-08-08 16:37:19 +0000 |
348 | @@ -16,7 +16,7 @@ |
349 | <div id="loggerheadCont"> |
350 | <h1> |
351 | Browsing |
352 | - <span metal:use-macro="breadcrumbs/directory" /> |
353 | + <span metal:use-macro="breadcrumbs.directory" /> |
354 | </h1> |
355 | |
356 | <div > |
357 | @@ -37,17 +37,17 @@ |
358 | </tr> |
359 | <tal:block repeat="dir dirs"> |
360 | |
361 | - <tal:branch-row tal:condition="dir/branch"> |
362 | - <tr tal:attributes="class string:blueRow${dir/parity}"> |
363 | + <tal:branch-row tal:condition="dir.branch"> |
364 | + <tr tal:attributes="class string:blueRow${dir.parity}"> |
365 | <td class="date"> |
366 | - <a tal:attributes="href string:${dir/dirname}/files"> |
367 | + <a tal:attributes="href string:${dir.dirname}/files"> |
368 | <img tal:attributes="src python:static_url('/static/images/ico_branch.gif')" alt="Branch" /> |
369 | </a> |
370 | - <a tal:attributes="href string:${dir/dirname}/files" tal:content="dir/dirname" /></td> |
371 | + <a tal:attributes="href string:${dir.dirname}/files" tal:content="dir.dirname" /></td> |
372 | <td class="date"> |
373 | - <a tal:attributes="href string:${dir/dirname}/revision/${dir/branch/revno}; |
374 | - title string:Show revision ${dir/branch/revno}" |
375 | - tal:content="dir/branch/revno"></a> |
376 | + <a tal:attributes="href string:${dir.dirname}/revision/${dir.branch.revno}; |
377 | + title string:Show revision ${dir.branch.revno}" |
378 | + tal:content="dir.branch.revno"></a> |
379 | </td> |
380 | <td class="date" tal:content="python:util._approximatedate(dir.last_change_time)"></td> |
381 | <td class="date" tal:content="python:util.hide_email(dir.last_revision.committer) if dir.last_revision is not None else 'Nobody'"></td> |
382 | @@ -55,15 +55,15 @@ |
383 | </tr> |
384 | |
385 | </tal:branch-row> |
386 | - <tal:non-branch-row tal:condition="not:dir/branch"> |
387 | - <tr tal:attributes="class string:blueRow${dir/parity}"> |
388 | + <tal:non-branch-row tal:condition="not:dir.branch"> |
389 | + <tr tal:attributes="class string:blueRow${dir.parity}"> |
390 | <td class="date"> |
391 | - <a tal:attributes="href string:${dir/dirname}/"> |
392 | + <a tal:attributes="href string:${dir.dirname}/"> |
393 | <img tal:attributes="src python:static_url('/static/images/ico_folder.gif')" alt="Folder" /> |
394 | </a> |
395 | - <a tal:attributes="href string:${dir/dirname}/" tal:content="dir/dirname" /></td> |
396 | + <a tal:attributes="href string:${dir.dirname}/" tal:content="dir.dirname" /></td> |
397 | <td class="date"></td> |
398 | - <td class="date" colspan="4" tal:content="dir/last_change"></td> |
399 | + <td class="date" colspan="4" tal:content="dir.last_change"></td> |
400 | </tr> |
401 | </tal:non-branch-row> |
402 | </tal:block> |
403 | |
404 | === modified file 'loggerhead/templates/error.pt' |
405 | --- loggerhead/templates/error.pt 2008-09-29 21:32:30 +0000 |
406 | +++ loggerhead/templates/error.pt 2022-08-08 16:37:19 +0000 |
407 | @@ -1,21 +1,21 @@ |
408 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
409 | <tal:block define="onload string:load()"> |
410 | - <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main"> |
411 | + <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros.main"> |
412 | <head> |
413 | <title metal:fill-slot="title" |
414 | - tal:content="string:${branch/friendly_name} : error"></title> |
415 | + tal:content="string:${branch.friendly_name} : error"></title> |
416 | </head> |
417 | <body> |
418 | <tal:block metal:fill-slot="heading"> |
419 | <h1> |
420 | - <tal:has-link condition="branch/branch_link"> |
421 | - <a tal:attributes="href branch/branch_link" |
422 | - tal:content="branch/friendly_name"> |
423 | + <tal:has-link condition="branch.branch_link"> |
424 | + <a tal:attributes="href branch.branch_link" |
425 | + tal:content="branch.friendly_name"> |
426 | nice/branch/name |
427 | </a> |
428 | </tal:has-link> |
429 | - <tal:no-link condition="not: branch/branch_link"> |
430 | - <span metal:use-macro="breadcrumbs/directory"></span> |
431 | + <tal:no-link condition="not: branch.branch_link"> |
432 | + <span metal:use-macro="breadcrumbs.directory"></span> |
433 | </tal:no-link> |
434 | : error |
435 | </h1> |
436 | |
437 | === modified file 'loggerhead/templates/feed-link.pt' |
438 | --- loggerhead/templates/feed-link.pt 2008-08-13 15:18:17 +0000 |
439 | +++ loggerhead/templates/feed-link.pt 2022-08-08 16:37:19 +0000 |
440 | @@ -1,6 +1,6 @@ |
441 | <tal:feed-link> |
442 | <a tal:attributes="href python:url(['/atom']); |
443 | - title string:RSS feed for ${branch/friendly_name}"> |
444 | + title string:RSS feed for ${branch.friendly_name}"> |
445 | <img tal:attributes="src python:branch.static_url('/static/images/ico_rss.gif')" alt="RSS" class="rssfeed"/> |
446 | </a> |
447 | </tal:feed-link> |
448 | |
449 | === modified file 'loggerhead/templates/filediff.pt' |
450 | --- loggerhead/templates/filediff.pt 2009-04-01 15:28:21 +0000 |
451 | +++ loggerhead/templates/filediff.pt 2022-08-08 16:37:19 +0000 |
452 | @@ -2,7 +2,7 @@ |
453 | <div class="pseudotable unified" |
454 | tal:repeat="chunk chunks"> |
455 | |
456 | - <tal:block condition="not:repeat/chunk/start"> |
457 | + <tal:block condition="not:repeat.chunk.start"> |
458 | <div class="pseudorow context-row"> |
459 | <div class="lineNumber separate"></div> |
460 | <div class="lineNumber second separate"></div> |
461 | @@ -11,13 +11,13 @@ |
462 | </div> |
463 | </tal:block> |
464 | |
465 | - <div tal:repeat="line chunk/diff" |
466 | - tal:attributes="class string:pseudorow ${line/type}-row"> |
467 | + <div tal:repeat="line chunk.diff" |
468 | + tal:attributes="class string:pseudorow ${line.type}-row"> |
469 | <div class="lineNumber first" |
470 | tal:content="structure python:util.fill_div(line.old_lineno)"></div> |
471 | <div class="lineNumber second" |
472 | tal:content="structure python:util.fill_div(line.new_lineno)"></div> |
473 | - <div tal:attributes="class string:code ${line/type}" |
474 | + <div tal:attributes="class string:code ${line.type}" |
475 | tal:content="structure python:util.fill_div(util.html_clean(line.line))"></div> |
476 | <div class="clear"><!-- --></div> |
477 | </div> |
478 | |
479 | === modified file 'loggerhead/templates/inventory.pt' |
480 | --- loggerhead/templates/inventory.pt 2022-07-06 12:45:28 +0000 |
481 | +++ loggerhead/templates/inventory.pt 2022-08-08 16:37:19 +0000 |
482 | @@ -1,8 +1,8 @@ |
483 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
484 | -<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main"> |
485 | +<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros.main"> |
486 | <head> |
487 | <title metal:fill-slot="title" |
488 | - tal:content="string:${branch/friendly_name} : files for revision ${change/revno}"></title> |
489 | + tal:content="string:${branch.friendly_name} : files for revision ${change.revno|nothing}"></title> |
490 | <metal:block fill-slot="header_extras"> |
491 | <link rel="stylesheet" type="text/css" media="all" |
492 | tal:attributes="href python:branch.static_url('/static/css/files.css')"/> |
493 | @@ -10,27 +10,27 @@ |
494 | </head> |
495 | <body> |
496 | <tal:block metal:fill-slot="backlink"> |
497 | - <tal:has-link condition="branch/branch_link"> |
498 | + <tal:has-link condition="branch.branch_link"> |
499 | <div class="black-link"> |
500 | - <a tal:attributes="href branch/branch_link"> |
501 | + <a tal:attributes="href branch.branch_link"> |
502 | ← Back to branch summary |
503 | </a> |
504 | </div> |
505 | </tal:has-link> |
506 | </tal:block> |
507 | - <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" /> |
508 | + <tal:block metal:fill-slot="branchname" tal:content="branch.friendly_name" /> |
509 | <tal:block metal:fill-slot="heading"> |
510 | <div id="breadcrumbs"> |
511 | - <tal:has-link condition="branch/branch_link"> |
512 | - <a tal:attributes="href branch/branch_link" |
513 | - tal:content="branch/friendly_name"> |
514 | + <tal:has-link condition="branch.branch_link"> |
515 | + <a tal:attributes="href branch.branch_link" |
516 | + tal:content="branch.friendly_name"> |
517 | nice/branch/name |
518 | </a> |
519 | </tal:has-link> |
520 | - <tal:no-link condition="not: branch/branch_link"> |
521 | - <span metal:use-macro="breadcrumbs/directory"></span> |
522 | + <tal:no-link condition="not: branch.branch_link"> |
523 | + <span metal:use-macro="breadcrumbs.directory"></span> |
524 | </tal:no-link> |
525 | - <span>: <span metal:use-macro="breadcrumbs/branch" /> (Revision <tal:revno content="change/revno"></tal:revno>)</span> |
526 | + <span>: <span metal:use-macro="breadcrumbs.branch" /> (Revision <tal:revno content="change.revno|nothing"></tal:revno>)</span> |
527 | </div> |
528 | </tal:block> |
529 | |
530 | @@ -77,25 +77,25 @@ |
531 | |
532 | <!-- Show this if it's a directory --> |
533 | <tal:block repeat="file filelist"> |
534 | - <tr tal:attributes="class string:blueRow${repeat/file/even}" tal:condition="python:file.kind=='directory'"> |
535 | + <tr tal:attributes="class string:blueRow${repeat.file.even}" tal:condition="python:file.kind=='directory'"> |
536 | <td class="date"><a tal:attributes="href python:url(['/files', revno_url, file.absolutepath])"> |
537 | <img tal:attributes="src python:branch.static_url('/static/images/ico_folder.gif'); |
538 | - title string:Go to ${file/filename}" /> |
539 | + title string:Go to ${file.filename}" /> |
540 | </a> |
541 | |
542 | <a tal:attributes="href python:url(['/files', revno_url, file.absolutepath])" |
543 | - tal:content="file/filename" class="link"></a> |
544 | + tal:content="file.filename" class="link"></a> |
545 | </td> |
546 | <td class="date"><a tal:attributes="href python:url(['/revision', file.change.revno]); |
547 | - title string:Show revision ${file/change/revno}" |
548 | - tal:content="file/change/revno"></a> |
549 | + title string:Show revision ${file.change.revno}" |
550 | + tal:content="file.change.revno"></a> |
551 | </td> |
552 | <td class="date" tal:content="python:util._approximatedate(file.change.utc_date)"></td> |
553 | <td class="date" tal:content="python:util.hide_email(file.change.committer)"></td> |
554 | <td class="autcell" tal:content="python:file.change.comment[:50]"></td> |
555 | <td class="timedate2"></td><!-- not showing sizes of folders --> |
556 | <td class="expcell"><a tal:attributes="href python:url(['/changes'], start_revid=start_revid, filter_path=file.absolutepath); |
557 | - title string:Show revision ${file/change/revno}"> |
558 | + title string:Show revision ${file.change.revno}"> |
559 | <img tal:attributes="src python:branch.static_url('/static/images/ico_planilla.gif')" alt="Diff" /> |
560 | </a> |
561 | </td> |
562 | @@ -103,48 +103,48 @@ |
563 | </tr> |
564 | |
565 | <!-- Show this if it's a symlink --> |
566 | - <tr tal:attributes="class string:blueRow${repeat/file/even}" tal:condition="python:file.kind=='symlink'"> |
567 | + <tr tal:attributes="class string:blueRow${repeat.file.even}" tal:condition="python:file.kind=='symlink'"> |
568 | <td class="date"><a tal:attributes="href python:url(['/view', change.revno, file.absolutepath])"> |
569 | <img tal:attributes="src python:branch.static_url('/static/images/ico_file_flecha.gif')" alt="Symlink" /> |
570 | </a> |
571 | |
572 | <a tal:attributes="href python:url(['/view', revno_url, file.absolutepath])" |
573 | - tal:content="file/filename" class="link"></a> |
574 | + tal:content="file.filename" class="link"></a> |
575 | </td> |
576 | <td class="date"><a tal:attributes="href python:url(['/revision', file.change.revno]); |
577 | - title string:Show revision ${file/change/revno}" |
578 | - tal:content="file/change/revno"></a> |
579 | + title string:Show revision ${file.change.revno}" |
580 | + tal:content="file.change.revno"></a> |
581 | </td> |
582 | <td class="date" tal:content="python:util._approximatedate(file.change.utc_date)"></td> |
583 | <td class="date" tal:content="python:util.hide_email(file.change.committer)"></td> |
584 | <td class="autcell" tal:content="python:file.change.comment[:50]"></td> |
585 | <td class="timedate2">.</td> |
586 | <td class="expcell"><a tal:attributes="href python:url(['/changes'], start_revid=start_revid, filter_path=file.absolutepath); |
587 | - title string:Show revision ${file/change/revno}"> |
588 | + title string:Show revision ${file.change.revno}"> |
589 | <img tal:attributes="src python:branch.static_url('/static/images/ico_planilla.gif'); |
590 | - title string:Show revision ${file/change/revno}" /> |
591 | + title string:Show revision ${file.change.revno}" /> |
592 | </a> |
593 | </td> |
594 | <td class="expcell"></td> |
595 | </tr> |
596 | |
597 | <!-- Show this if it's a regular file --> |
598 | - <tr tal:attributes="class string:blueRow${repeat/file/even}" tal:condition="python:file.kind=='file'"> |
599 | + <tr tal:attributes="class string:blueRow${repeat.file.even}" tal:condition="python:file.kind=='file'"> |
600 | <td class="date"><a tal:attributes="href python:url(['/view', revno_url, file.absolutepath])"> |
601 | <img tal:attributes="src python:branch.static_url('/static/images/ico_file.gif'); |
602 | - title string:View ${file/filename}" |
603 | + title string:View ${file.filename}" |
604 | tal:condition="python:file.executable is False" /> |
605 | <!-- Show a different icon id the file executable --> |
606 | <img tal:attributes="src python:branch.static_url('/static/images/ico_file_modify.gif'); |
607 | - title string:View ${file/filename}" |
608 | + title string:View ${file.filename}" |
609 | tal:condition="python:file.executable is True" alt="File" /> |
610 | </a> |
611 | |
612 | <a tal:attributes="href python:url(['/view', revno_url, file.absolutepath])" |
613 | - tal:content="file/filename" class="link"></a></td> |
614 | + tal:content="file.filename" class="link"></a></td> |
615 | <td class="date"><a tal:attributes="href python:url(['/revision', file.change.revno]); |
616 | - title string:Show revision ${file/change/revno}" |
617 | - tal:content="file/change/revno"></a> |
618 | + title string:Show revision ${file.change.revno}" |
619 | + tal:content="file.change.revno"></a> |
620 | </td> |
621 | <td class="date" tal:content="python:util._approximatedate(file.change.utc_date)"></td> |
622 | <td class="date" tal:content="python:util.hide_email(file.change.committer)"></td> |
623 | @@ -152,13 +152,13 @@ |
624 | |
625 | <td class="timedate2" tal:content="python:util.human_size(file.size)"></td> |
626 | <td class="expcell"><a tal:attributes="href python:url(['/view', revno_url, file.absolutepath]); |
627 | - title string:View ${file/filename}"> |
628 | + title string:View ${file.filename}"> |
629 | <img tal:attributes="src python:branch.static_url('/static/images/ico_planilla.gif')" alt="Diff" /> |
630 | </a> |
631 | </td> |
632 | <td class="expcell"> |
633 | <a tal:attributes="href python:url(['/download', file.revid.decode('utf-8'), file.filename]); |
634 | - title string:Download ${file/filename} at revision ${file/change/revno}"> |
635 | + title string:Download ${file.filename} at revision ${file.change.revno}"> |
636 | <img tal:attributes="src python:branch.static_url('/static/images/ico_file_download.gif')" alt="Download File" /> |
637 | </a> |
638 | </td> |
639 | |
640 | === modified file 'loggerhead/templates/macros.pt' |
641 | --- loggerhead/templates/macros.pt 2020-06-04 19:43:36 +0000 |
642 | +++ loggerhead/templates/macros.pt 2022-08-08 16:37:19 +0000 |
643 | @@ -35,7 +35,7 @@ |
644 | <h1 class="branch-name"> |
645 | <span metal:define-slot="branchname" /> |
646 | </h1> |
647 | - <tal:menu define="fileview_active fileview_active" |
648 | + <tal:menu define="fileview_active fileview_active|False" |
649 | replace="structure python:menu(branch, url, fileview_active)" /> |
650 | <div id="loggerheadCont"> |
651 | |
652 | |
653 | === modified file 'loggerhead/templates/revision.pt' |
654 | --- loggerhead/templates/revision.pt 2015-03-17 15:12:05 +0000 |
655 | +++ loggerhead/templates/revision.pt 2022-08-08 16:37:19 +0000 |
656 | @@ -1,9 +1,9 @@ |
657 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
658 | <tal:block define="onload string:load()"> |
659 | - <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main"> |
660 | + <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros.main"> |
661 | <head> |
662 | <title metal:fill-slot="title" |
663 | - tal:content="string:${branch/friendly_name} : revision ${change/revno}"> |
664 | + tal:content="string:${branch.friendly_name} : revision ${change.revno}"> |
665 | </title> |
666 | |
667 | <metal:block fill-slot="header_extras"> |
668 | @@ -21,29 +21,29 @@ |
669 | |
670 | <body> |
671 | <tal:block metal:fill-slot="backlink"> |
672 | - <tal:has-link condition="branch/branch_link"> |
673 | + <tal:has-link condition="branch.branch_link"> |
674 | <div class="black-link"> |
675 | - <a tal:attributes="href branch/branch_link"> |
676 | + <a tal:attributes="href branch.branch_link"> |
677 | ← Back to branch summary |
678 | </a> |
679 | </div> |
680 | </tal:has-link> |
681 | </tal:block> |
682 | - <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" /> |
683 | + <tal:block metal:fill-slot="branchname" tal:content="branch.friendly_name" /> |
684 | <tal:block metal:fill-slot="heading"> |
685 | <div id="breadcrumbs"> |
686 | - <tal:has-link condition="branch/branch_link"> |
687 | - <a tal:attributes="href branch/branch_link" |
688 | - tal:content="branch/friendly_name"> |
689 | + <tal:has-link condition="branch.branch_link"> |
690 | + <a tal:attributes="href branch.branch_link" |
691 | + tal:content="branch.friendly_name"> |
692 | nice/branch/name |
693 | </a> |
694 | </tal:has-link> |
695 | - <tal:no-link condition="not: branch/branch_link"> |
696 | - <span metal:use-macro="breadcrumbs/directory"></span> |
697 | + <tal:no-link condition="not: branch.branch_link"> |
698 | + <span metal:use-macro="breadcrumbs.directory"></span> |
699 | </tal:no-link> |
700 | <span class="breadcrumb">» Revision |
701 | - <tal:revno condition="not:specific_path" content="change/revno"></tal:revno> |
702 | - <a tal:condition="specific_path" tal:content="change/revno" |
703 | + <tal:revno condition="not:specific_path" content="change.revno"></tal:revno> |
704 | + <a tal:condition="specific_path" tal:content="change.revno" |
705 | tal:attributes="href python:url(['/revision', change.revno])" |
706 | title="View changes to all files"></a> |
707 | <tal:compare-to condition="python:compare_revid is not None"> |
708 | @@ -56,7 +56,7 @@ |
709 | </div> |
710 | <tal:branch-info replace="structure python:branchinfo(branch)" /> |
711 | <h1 tal:condition="not:specific_path"> |
712 | - Viewing all changes in revision <tal:revno content="change/revno" />. |
713 | + Viewing all changes in revision <tal:revno content="change.revno" />. |
714 | </h1> |
715 | <p tal:condition="specific_path"> |
716 | <a tal:attributes="href python:url(['/revision', change.revno])"> |
717 | @@ -68,8 +68,8 @@ |
718 | </p> |
719 | <ul id="submenuTabs"> |
720 | <li id="first"><a tal:attributes="href python:url(['/files', change.revno]); |
721 | - title string:browse files at revision ${change/revno}" |
722 | - tal:content="string:browse files at revision ${change/revno}"></a></li> |
723 | + title string:browse files at revision ${change.revno}" |
724 | + tal:content="string:browse files at revision ${change.revno}"></a></li> |
725 | <li tal:condition="python:remember != change.revno"> |
726 | <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None); |
727 | title string:compare with another revision" |
728 | @@ -89,15 +89,15 @@ |
729 | <a tal:attributes="href python:url(['/tarball', change.revno])">download tarball</a> |
730 | </li> |
731 | <li id="last"><a tal:attributes="href python:url(['/changes', change.revno]); |
732 | - title string:view history from revision ${change/revno}" |
733 | - tal:content="string:view history from revision ${change/revno}"></a></li> |
734 | + title string:view history from revision ${change.revno}" |
735 | + tal:content="string:view history from revision ${change.revno}"></a></li> |
736 | </ul> |
737 | |
738 | <tal:we-are-comparing condition="python:compare_revid is not None"> |
739 | <ul id="submenuTabs"> |
740 | <li id="first"> |
741 | <a tal:attributes="href python:url([ '/revision', history.get_revno(compare_revid) ], remember=change.revno, compare_revid=change.revno)"> |
742 | - reverse the comparison (<tal:b content="change/revno" /> to <tal:b content="python:history.get_revno(compare_revid)" />) |
743 | + reverse the comparison (<tal:b content="change.revno" /> to <tal:b content="python:history.get_revno(compare_revid)" />) |
744 | </a> |
745 | </li> |
746 | <li id="last"> |
747 | @@ -151,7 +151,7 @@ |
748 | <div class="pseudotable unified" |
749 | tal:repeat="chunk diff_chunks"> |
750 | |
751 | - <tal:block condition="not:repeat/chunk/start"> |
752 | + <tal:block condition="not:repeat.chunk.start"> |
753 | <div class="pseudorow context-row"> |
754 | <div class="lineNumber separate"></div> |
755 | <div class="lineNumber second separate"></div> |
756 | @@ -160,13 +160,13 @@ |
757 | </div> |
758 | </tal:block> |
759 | |
760 | - <div tal:repeat="line chunk/diff" |
761 | - tal:attributes="class string:pseudorow ${line/type}-row"> |
762 | + <div tal:repeat="line chunk.diff" |
763 | + tal:attributes="class string:pseudorow ${line.type}-row"> |
764 | <div class="lineNumber first" |
765 | tal:content="structure python:util.fill_div(line.old_lineno)"></div> |
766 | <div class="lineNumber second" |
767 | tal:content="structure python:util.fill_div(line.new_lineno)"></div> |
768 | - <div tal:attributes="class string:code ${line/type}" |
769 | + <div tal:attributes="class string:code ${line.type}" |
770 | tal:content="structure python:util.fill_div(util.html_clean(line.line))"></div> |
771 | <div class="clear"><!-- --></div> |
772 | </div> |
773 | @@ -179,16 +179,16 @@ |
774 | |
775 | <tal:block condition="not:specific_path"> |
776 | <div class="diff" |
777 | - tal:repeat="item file_changes/text_changes" tal:attributes="id string:diff-${item/index}"> |
778 | + tal:repeat="item file_changes.text_changes" tal:attributes="id string:diff-${item.index}"> |
779 | |
780 | <div class="diffBox"> |
781 | <a tal:attributes="href python:url(['/revision', change.revno, item.filename], clear=1); |
782 | - id string:${item/filename}; |
783 | - title string:View changes to ${item/filename} only" |
784 | + id string:${item.filename}; |
785 | + title string:View changes to ${item.filename} only" |
786 | class="the-link"> |
787 | <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')" |
788 | class="expand_diff" /> |
789 | - <tal:b content="item/filename" /> |
790 | + <tal:b content="item.filename" /> |
791 | </a> |
792 | </div> |
793 | <div class="diffinfo" style="display:none"> |
794 | @@ -201,9 +201,9 @@ |
795 | |
796 | <ul tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid" |
797 | id="pages"> |
798 | - <li tal:condition="navigation/prev_page_revid" |
799 | + <li tal:condition="navigation.prev_page_revid" |
800 | class="previous"> |
801 | - <a tal:attributes="href navigation/prev_page_url">« Newer</a> |
802 | + <a tal:attributes="href navigation.prev_page_url">« Newer</a> |
803 | </li> |
804 | <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them, |
805 | so some magic has to be done to just show the previous and next N page numbers |
806 | @@ -213,9 +213,9 @@ |
807 | <li><a href="#" |
808 | tal:content="page_number"></a></li> |
809 | </tal:block>--> |
810 | - <li tal:condition="navigation/next_page_revid" |
811 | + <li tal:condition="navigation.next_page_revid" |
812 | class="next"> |
813 | - <a tal:attributes="href navigation/next_page_url">Older »</a> |
814 | + <a tal:attributes="href navigation.next_page_url">Older »</a> |
815 | </li> |
816 | </ul> |
817 | |
818 | |
819 | === modified file 'loggerhead/templates/revisionfilechanges.pt' |
820 | --- loggerhead/templates/revisionfilechanges.pt 2012-09-21 16:58:01 +0000 |
821 | +++ loggerhead/templates/revisionfilechanges.pt 2022-08-08 16:37:19 +0000 |
822 | @@ -1,6 +1,6 @@ |
823 | <tal:block> |
824 | - <ul tal:repeat="added file_changes/added"> |
825 | - <tal:block condition="repeat/added/start"> |
826 | + <ul tal:repeat="added file_changes.added"> |
827 | + <tal:block condition="repeat.added.start"> |
828 | <li class="desc">files added:</li> |
829 | </tal:block> |
830 | <li class="files" tal:omit-tag="python:added.filename == ''" |
831 | @@ -8,47 +8,47 @@ |
832 | <tal:revision condition="python:added.kind == 'file'" |
833 | content="structure python:file_link(added.filename)" /> |
834 | <tal:revision condition="python:added.kind != 'file'" |
835 | - content="added/filename" /> |
836 | + content="added.filename" /> |
837 | </li> |
838 | </ul> |
839 | |
840 | - <ul tal:repeat="removed file_changes/removed"> |
841 | - <tal:block condition="repeat/removed/start"> |
842 | + <ul tal:repeat="removed file_changes.removed"> |
843 | + <tal:block condition="repeat.removed.start"> |
844 | <li class="desc">files removed:</li> |
845 | </tal:block> |
846 | <li class="files"> |
847 | <tal:revision condition="python:removed.kind == 'file'" |
848 | content="structure python:file_link(removed.filename)" /> |
849 | <tal:revision condition="python:removed.kind != 'file'" |
850 | - content="removed/filename" /> |
851 | + content="removed.filename" /> |
852 | </li> |
853 | </ul> |
854 | |
855 | - <ul tal:repeat="renamed file_changes/renamed"> |
856 | - <tal:block condition="repeat/renamed/start"> |
857 | + <ul tal:repeat="renamed file_changes.renamed"> |
858 | + <tal:block condition="repeat.renamed.start"> |
859 | <li class="desc">files renamed:</li> |
860 | </tal:block> |
861 | <li class="files"> |
862 | - <tal:old-name content="renamed/old_filename" class="filename"> |
863 | + <span tal:content="renamed.old_filename" class="filename"> |
864 | old_filename |
865 | - </tal:old-name> |
866 | + </span> |
867 | => |
868 | - <tal:revision condition="renamed/text_modified" content="structure python:file_link(renamed.new_filename)" /> |
869 | - <tal:old-name condition="not:renamed/text_modified" content="renamed/new_filename" class="filename"> |
870 | + <tal:revision condition="renamed.text_modified" content="structure python:file_link(renamed.new_filename)" /> |
871 | + <span tal:condition="not:renamed.text_modified" tal:content="renamed.new_filename" class="filename"> |
872 | new_filename |
873 | - </tal:old-name> |
874 | - <tal:prop-change condition="renamed/exe_change" content="string:*" /> |
875 | + </span> |
876 | + <tal:prop-change condition="renamed.exe_change" content="string:*" /> |
877 | </li> |
878 | </ul> |
879 | |
880 | - <ul tal:repeat="item file_changes/modified"> |
881 | - <tal:block condition="repeat/item/start"> |
882 | + <ul tal:repeat="item file_changes.modified"> |
883 | + <tal:block condition="repeat.item.start"> |
884 | <li class="desc">files modified:</li> |
885 | </tal:block> |
886 | <li class="files"> |
887 | - <tal:revision condition="item/text_modified" content="structure python:file_link(item.filename)" /> |
888 | - <tal:revision condition="not:item/text_modified" content="item/filename" /> |
889 | - <tal:prop-change condition="item/exe_change" content="string:*" /> |
890 | + <tal:revision condition="item.text_modified" content="structure python:file_link(item.filename)" /> |
891 | + <tal:revision condition="not:item.text_modified" content="item.filename" /> |
892 | + <tal:prop-change condition="item.exe_change" content="string:*" /> |
893 | </li> |
894 | </ul> |
895 | </tal:block> |
896 | |
897 | === modified file 'loggerhead/templates/revisioninfo.pt' |
898 | --- loggerhead/templates/revisioninfo.pt 2012-02-02 07:42:24 +0000 |
899 | +++ loggerhead/templates/revisioninfo.pt 2022-08-08 16:37:19 +0000 |
900 | @@ -16,15 +16,15 @@ |
901 | <li class="mfrom" tal:condition="python:change.parents[1:]"> |
902 | <strong>mfrom:</strong> |
903 | <span tal:repeat="parent python:change.parents[1:]"> |
904 | - <a tal:attributes="title string:Merged From ${parent/revno}; |
905 | + <a tal:attributes="title string:Merged From ${parent.revno}; |
906 | href python:url(['/revision', parent.revno], clear=1)" |
907 | tal:content="python:revno_with_nick(parent)"></a> |
908 | </span> |
909 | </li> |
910 | - <li class="mto" tal:condition="change/merge_points"> |
911 | + <li class="mto" tal:condition="change.merge_points"> |
912 | <strong>mto:</strong> |
913 | - <span tal:repeat="merge_point change/merge_points"> |
914 | - <a tal:attributes="title string:Merged In ${merge_point/revno}; |
915 | + <span tal:repeat="merge_point change.merge_points"> |
916 | + <a tal:attributes="title string:Merged In ${merge_point.revno}; |
917 | href python:url(['/revision', merge_point.revno], clear=1)" |
918 | tal:content="python:revno_with_nick(merge_point)"></a> |
919 | </span> |
920 | @@ -37,16 +37,16 @@ |
921 | </li> |
922 | <li class="revid"> |
923 | <strong>Revision ID:</strong> |
924 | - <span tal:content="change/revid"></span> |
925 | + <span tal:content="change.revid"></span> |
926 | </li> |
927 | </ul> |
928 | - <div tal:attributes="class string:foreign-${change/foreign_vcs}" |
929 | - tal:condition="change/foreign_vcs" |
930 | + <div tal:attributes="class string:foreign-${change.foreign_vcs}" |
931 | + tal:condition="hasattr(change, 'foreign_vcs')" |
932 | tal:repeat="revid_part python:change.foreign_revid.keys()" |
933 | tal:content="python:'%s: %s' % (revid_part, change.foreign_revid[revid_part])"/> |
934 | - <div class="tags" tal:condition="change/tags" tal:content="string:Tags: ${change/tags}"></div> |
935 | + <div class="tags" tal:condition="change.tags" tal:content="string:Tags: ${change.tags}"></div> |
936 | <div class="clear"><!-- --></div> |
937 | - <div class="bug" tal:repeat="bug change/bugs"> |
938 | + <div class="bug" tal:repeat="bug change.bugs"> |
939 | <a tal:attributes="href bug" tal:content="bug"></a> |
940 | </div> |
941 | <div class="information" tal:content="structure python:util.fixed_width(change.comment)"></div> |
942 | |
943 | === modified file 'loggerhead/templates/revlog.pt' |
944 | --- loggerhead/templates/revlog.pt 2009-03-31 15:23:54 +0000 |
945 | +++ loggerhead/templates/revlog.pt 2022-08-08 16:37:19 +0000 |
946 | @@ -6,7 +6,7 @@ |
947 | tal:content="python:revno_with_nick(parent)"></a> |
948 | </span> |
949 | </li> |
950 | - <li class="mto" tal:repeat="merge_point entry/merge_points"> |
951 | + <li class="mto" tal:repeat="merge_point entry.merge_points"> |
952 | <a tal:attributes="href python:url(['/changes', merge_point.revno])" |
953 | tal:content="python:revno_with_nick(merge_point)" |
954 | title="Show history" class="link"></a> |
955 | |
956 | === modified file 'loggerhead/templates/view.pt' |
957 | --- loggerhead/templates/view.pt 2022-07-06 12:45:28 +0000 |
958 | +++ loggerhead/templates/view.pt 2022-08-08 16:37:19 +0000 |
959 | @@ -1,10 +1,10 @@ |
960 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
961 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
962 | -<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main"> |
963 | +<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros.main"> |
964 | <head> |
965 | <title metal:fill-slot="title" |
966 | - tal:content="string:${branch/friendly_name} : contents of ${file_path} |
967 | - at revision ${change/revno}"> |
968 | + tal:content="string:${branch.friendly_name} : contents of ${file_path} |
969 | + at revision ${change.revno}"> |
970 | </title> |
971 | <metal:block fill-slot="header_extras"> |
972 | <link rel="stylesheet" type="text/css" media="all" |
973 | @@ -16,27 +16,27 @@ |
974 | |
975 | <body> |
976 | <tal:block metal:fill-slot="backlink"> |
977 | - <tal:has-link condition="branch/branch_link"> |
978 | + <tal:has-link condition="branch.branch_link"> |
979 | <div class="black-link"> |
980 | - <a tal:attributes="href branch/branch_link"> |
981 | + <a tal:attributes="href branch.branch_link"> |
982 | ← Back to branch summary |
983 | </a> |
984 | </div> |
985 | </tal:has-link> |
986 | </tal:block> |
987 | - <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" /> |
988 | + <tal:block metal:fill-slot="branchname" tal:content="branch.friendly_name" /> |
989 | <tal:block metal:fill-slot="heading"> |
990 | <div id="breadcrumbs"> |
991 | - <tal:has-link condition="branch/branch_link"> |
992 | - <a tal:attributes="href branch/branch_link" |
993 | - tal:content="branch/friendly_name"> |
994 | + <tal:has-link condition="branch.branch_link"> |
995 | + <a tal:attributes="href branch.branch_link" |
996 | + tal:content="branch.friendly_name"> |
997 | nice/branch/name |
998 | </a> |
999 | </tal:has-link> |
1000 | - <tal:no-link condition="not: branch/branch_link"> |
1001 | - <span metal:use-macro="breadcrumbs/directory"></span> |
1002 | + <tal:no-link condition="not: branch.branch_link"> |
1003 | + <span metal:use-macro="breadcrumbs.directory"></span> |
1004 | </tal:no-link> |
1005 | - <span>: <span metal:use-macro="breadcrumbs/branch" /> (revision <tal:revno content="change/revno"></tal:revno>)</span> |
1006 | + <span>: <span metal:use-macro="breadcrumbs.branch" /> (revision <tal:revno content="change.revno"></tal:revno>)</span> |
1007 | </div> |
1008 | </tal:block> |
1009 | |
1010 | @@ -73,8 +73,8 @@ |
1011 | <table id="logentries"> |
1012 | <tal:rep tal:condition="annotated" tal:repeat="line contents"> |
1013 | <tr> |
1014 | - <td tal:condition="python:path('repeat/line/number') in annotated" |
1015 | - tal:define="anno python:annotated.get(path('repeat/line/number'), None)" |
1016 | + <td tal:condition="python:repeat.line.number in annotated" |
1017 | + tal:define="anno python:annotated.get(repeat.line.number, None)" |
1018 | tal:attributes="rowspan python:anno.revspan" |
1019 | class="viewRev"> |
1020 | <a tal:content="python:'%s' % (anno.change.revno,)" |
1021 | @@ -85,9 +85,9 @@ |
1022 | |
1023 | <span tal:content="python:anno.message"></span> |
1024 | </td> |
1025 | - <td tal:attributes="class python:path('repeat/line/number') in annotated and 'viewLine first' or 'viewLine'"> |
1026 | - <pre><a tal:attributes="id string:L${repeat/line/number}; href string:#L${repeat/line/number}" |
1027 | - tal:content="repeat/line/number">1</a></pre> |
1028 | + <td tal:attributes="class python:repeat.line.number in annotated and 'viewLine first' or 'viewLine'"> |
1029 | + <pre><a tal:attributes="id string:L${repeat.line.number}; href string:#L${repeat.line.number}" |
1030 | + tal:content="repeat.line.number">1</a></pre> |
1031 | </td> |
1032 | <td class="viewCont"><pre tal:content="structure line"></pre></td> |
1033 | </tr> |
1034 | |
1035 | === modified file 'loggerhead/tests/test_controllers.py' |
1036 | --- loggerhead/tests/test_controllers.py 2022-07-06 12:45:28 +0000 |
1037 | +++ loggerhead/tests/test_controllers.py 2022-08-08 16:37:19 +0000 |
1038 | @@ -32,7 +32,6 @@ |
1039 | |
1040 | from ..apps.branch import BranchWSGIApp |
1041 | from ..controllers.annotate_ui import AnnotateUI |
1042 | -from ..controllers.inventory_ui import InventoryUI |
1043 | from .test_simple import ( |
1044 | BasicTests, |
1045 | consume_app, |
1046 | @@ -50,35 +49,51 @@ |
1047 | self.addCleanup(tree.branch.lock_read().unlock) |
1048 | return tree.branch |
1049 | |
1050 | - def make_bzrbranch_and_inventory_ui_for_tree_shape(self, shape): |
1051 | + def make_bzrbranch_and_inventory_ui_for_tree_shape(self, shape, env): |
1052 | branch = self.make_bzrbranch_for_tree_shape(shape) |
1053 | branch_app = self.make_branch_app(branch) |
1054 | - return branch, InventoryUI(branch_app, branch_app.get_history) |
1055 | + return branch, branch_app.lookup_app(env) |
1056 | |
1057 | def test_get_filelist(self): |
1058 | + env = { |
1059 | + 'SCRIPT_NAME': '', |
1060 | + 'PATH_INFO': '/files', |
1061 | + 'wsgi.url_scheme': 'http', |
1062 | + 'SERVER_NAME': 'localhost', |
1063 | + 'SERVER_PORT': '80', |
1064 | + } |
1065 | bzrbranch, inv_ui = self.make_bzrbranch_and_inventory_ui_for_tree_shape( |
1066 | - ['filename']) |
1067 | + ['filename'], env) |
1068 | revtree = bzrbranch.repository.revision_tree(bzrbranch.last_revision()) |
1069 | self.assertEqual(1, len(inv_ui.get_filelist(revtree, '', 'filename', 'head'))) |
1070 | |
1071 | def test_smoke(self): |
1072 | + env = { |
1073 | + 'SCRIPT_NAME': '', |
1074 | + 'PATH_INFO': '/files', |
1075 | + 'wsgi.url_scheme': 'http', |
1076 | + 'SERVER_NAME': 'localhost', |
1077 | + 'SERVER_PORT': '80', |
1078 | + } |
1079 | bzrbranch, inv_ui = self.make_bzrbranch_and_inventory_ui_for_tree_shape( |
1080 | - ['filename']) |
1081 | - start, content = consume_app(inv_ui, |
1082 | - {'SCRIPT_NAME': '/files', 'PATH_INFO': ''}) |
1083 | + ['filename'], env) |
1084 | + start, content = consume_app(inv_ui, env) |
1085 | self.assertEqual(('200 OK', [('Content-Type', 'text/html')], None), |
1086 | start) |
1087 | self.assertContainsRe(content, b'filename') |
1088 | |
1089 | def test_no_content_for_HEAD(self): |
1090 | + env = { |
1091 | + 'SCRIPT_NAME': '', |
1092 | + 'PATH_INFO': '/files', |
1093 | + 'REQUEST_METHOD': 'HEAD', |
1094 | + 'wsgi.url_scheme': 'http', |
1095 | + 'SERVER_NAME': 'localhost', |
1096 | + 'SERVER_PORT': '80', |
1097 | + } |
1098 | bzrbranch, inv_ui = self.make_bzrbranch_and_inventory_ui_for_tree_shape( |
1099 | - ['filename']) |
1100 | - start, content = consume_app(inv_ui, |
1101 | - {'SCRIPT_NAME': '/files', 'PATH_INFO': '', |
1102 | - 'REQUEST_METHOD': 'HEAD', |
1103 | - 'wsgi.url_scheme': 'http', |
1104 | - 'SERVER_NAME': 'localhost', |
1105 | - 'SERVER_PORT': '80'}) |
1106 | + ['filename'], env) |
1107 | + start, content = consume_app(inv_ui, env) |
1108 | self.assertEqual(('200 OK', [('Content-Type', 'text/html')], None), |
1109 | start) |
1110 | self.assertEqual(b'', content) |
1111 | |
1112 | === modified file 'loggerhead/zptsupport.py' |
1113 | --- loggerhead/zptsupport.py 2020-05-06 19:18:04 +0000 |
1114 | +++ loggerhead/zptsupport.py 2022-08-08 16:37:19 +0000 |
1115 | @@ -13,15 +13,13 @@ |
1116 | # along with this program; if not, write to the Free Software |
1117 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
1118 | # |
1119 | -"""Support for Zope Page Templates using the simpletal library.""" |
1120 | +"""Support for Zope Page Templates using the Chameleon library.""" |
1121 | |
1122 | -import logging |
1123 | import os |
1124 | import pkg_resources |
1125 | import re |
1126 | -from io import StringIO |
1127 | |
1128 | -from simpletal import simpleTAL, simpleTALES |
1129 | +from chameleon import PageTemplate |
1130 | |
1131 | _zpt_cache = {} |
1132 | |
1133 | @@ -35,7 +33,7 @@ |
1134 | text = re.sub(r'\s*\n\s*', '\n', text) |
1135 | text = re.sub(r'[ \t]+', ' ', text) |
1136 | tinstance = _zpt_cache[tfile] = TemplateWrapper( |
1137 | - simpleTAL.compileXMLTemplate(text), tfile, stat) |
1138 | + PageTemplate(text), tfile, stat) |
1139 | return tinstance |
1140 | |
1141 | |
1142 | @@ -47,18 +45,10 @@ |
1143 | self.stat = stat |
1144 | |
1145 | def expand(self, **info): |
1146 | - context = simpleTALES.Context(allowPythonPath=1) |
1147 | - for k, v in info.items(): |
1148 | - context.addGlobal(k, v) |
1149 | - s = StringIO() |
1150 | - self.template.expandInline(context, s) |
1151 | - return s.getvalue() |
1152 | + return self.template(**info) |
1153 | |
1154 | def expand_into(self, f, **info): |
1155 | - context = simpleTALES.Context(allowPythonPath=1) |
1156 | - for k, v in info.items(): |
1157 | - context.addGlobal(k, v) |
1158 | - self.template.expand(context, f, outputEncoding='utf-8') |
1159 | + f.write(self.template(**info).encode('UTF-8')) |
1160 | |
1161 | @property |
1162 | def macros(self): |
1163 | |
1164 | === modified file 'requirements.txt' |
1165 | --- requirements.txt 2022-07-11 13:08:09 +0000 |
1166 | +++ requirements.txt 2022-08-08 16:37:19 +0000 |
1167 | @@ -8,7 +8,6 @@ |
1168 | bleach; python_version > "3.5" |
1169 | bleach < 4.0.0; python_version <= "3.5" |
1170 | packaging < 21.0; python_version <= "3.5" |
1171 | -https://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-5.2.tar.gz |
1172 | Pygments < 2.12; python_version <= "3.5" |
1173 | Pygments; python_version > "3.5" |
1174 | certifi < 2022.5.18; python_version <= "3.5" |
13:28 <jelmer> cjwatson: the MR changing simpletal to chameleon LGTM
Jelmer isn't near his Launchpad credentials at the moment, so self-approving as a proxy for his review.