Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: xartoc.xml.tmpl

Issue 29349885: Issue 4340 - Drop dependency on external xar tool (Closed)
Patch Set: Added template for ToC generation and rebased Created Aug. 17, 2016, 10:04 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« xarfile.py ('K') | « xarfile.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4 - This Source Code Form is subject to the terms of the Mozilla Public
5 - License, v. 2.0. If a copy of the MPL was not distributed with this
6 - file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 -->
8
9 {% macro file(data) %}
Sebastian Noack 2016/08/17 12:53:45 Why a macro? Couldn't you simply nest the code bel
Sebastian Noack 2016/08/17 18:41:33 What is about this comment?
Wladimir Palant 2016/08/17 18:52:18 How so? It's recursive.
Sebastian Noack 2016/08/17 18:58:46 Sorry, you are right. (But mind the other two comm
10 <file id="{{data.id}}">
11 <name>{{data.name}}</name>
12 <type>{{data.type}}</type>
13 <mode>{{data.mode}}</mode>
14 {% if data.type == 'directory' %}
15 {% for f in data.children %}
16 {{file(f)}}
17 {% endfor %}
18 {% else %}
19 <data>
20 <archived-checksum style="sha1">{{data.checksum_compressed}}</archived-che cksum>
21 <extracted-checksum style="sha1">{{data.checksum_uncompressed}}</extracted -checksum>
22 <encoding style="application/x-gzip"/>
23 <size>{{data.size_uncompressed}}</size>
24 <offset>{{data.offset}}</offset>
25 <length>{{data.size_compressed}}</length>
26 </data>
27 {% endif %}
28 </file>
29 {% endmacro %}
30
31 <xar>
32 <toc>
33 <signature-creation-time>{{timestamp_numerical}}</signature-creation-time>
34 <checksum style="sha1">
35 <offset>{{checksum.offset}}</offset>
36 <size>{{checksum.size}}</size>
37 </checksum>
38 <creation-time>{{timestamp_iso}}</creation-time>
39 <signature style="RSA">
40 <offset>{{signature.offset}}</offset>
41 <size>{{signature.size}}</size>
42 <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
43 <X509Data>
44 {% for certificate in certificates %}
45 <X509Certificate>{{certificate}}</X509Certificate>
46 {% endfor %}
47 </X509Data>
48 </KeyInfo>
49 </signature>
50 {% for f in files %}
51 {{file(f)}}
52 {% endfor %}
53 </toc>
54 </xar>
OLDNEW
« xarfile.py ('K') | « xarfile.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld