This file is indexed.

/usr/lib/python3/dist-packages/diffoscope/presenters/html/templates.py is in diffoscope 93ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.

HEADER = u"""<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta http-equiv="x-ua-compatible" content="IE=edge">
  <meta name="referrer" content="no-referrer" />
  <meta name="generator" content="diffoscope" />
  <link rel="icon" type="image/png" href="%(favicon)s" />
  <title>%(title)s</title>
%(css_style)s%(css_link)s</head>
<body class="diffoscope">
"""

FOOTER = u"""<div class="footer">Generated by <a href="https://diffoscope.org" rel="noopener noreferrer" target="_blank">diffoscope</a> %(version)s</div>
</body>
</html>
"""

STYLES = u"""body.diffoscope {
  background: white;
  color: black;
}
.diffoscope .footer {
  font-size: small;
}
.diffoscope .difference {
  border: outset #888 1px;
  background: #E8E8E8;
  background: rgba(0,0,0,.1);
  padding: 0.5em;
  margin: 0.5em 0;
}
.diffoscope .difference table {
  table-layout: fixed;
  width: 100%;
  border: 0;
}
.diffoscope .difference th,
.diffoscope .difference td {
  border: 0;
}
.diffoscope table.diff {
  border: 0;
  border-collapse:collapse;
  font-size:0.75em;
  font-family: 'Lucida Console', monospace;
}
.diffoscope table.diff tr:hover td {
  background: #FFFF00;
}
.diffoscope .line {
  color:#8080a0
}
.diffoscope th {
  background: black;
  color: white
}
.diffoscope .diffunmodified td {
  background: #D0D0E0
}
.diffoscope .diffhunk td {
  background: #A0A0A0
}
.diffoscope .diffadded td {
  background: #CCFFCC
}
.diffoscope .diffdeleted td {
  background: #FFCCCC
}
.diffoscope .diffchanged td {
  background: #FFFFA0
}
.diffoscope ins, del {
  background: #E0C880;
  text-decoration: none
}
.diffoscope .diffponct {
  color: #B08080
}
.diffoscope .comment {
  font-style: italic;
}
.diffoscope .source {
  font-weight: bold;
}
.diffoscope .error {
  border: solid black 1px;
  background: red;
  color: white;
  padding: 0.2em;
}
.diffoscope .anchor {
  margin-left: 0.5em;
  font-size: 80%;
  color: #333;
  text-decoration: none;
  display: none;
}
.diffoscope .diffheader:hover .anchor {
  display: inline;
}
.diffoscope .diffcontrol, .diffoscope .diffcontrol-nochildren {
  float: left;
  margin-right: 0.3em;
  cursor: pointer;
  display: none; /* currently, only available in html-dir output where jquery is enabled */
}
.diffoscope .colines {
  width: 3em;
}
.diffoscope .coldiff {
  width: 99%;
}
.diffoscope .diffsize {
  float: right;
}
"""

SCRIPTS = u"""<script src="%(jquery_url)s"></script>
<script type="text/javascript">
$(function() {
  // activate "loading" controls
  var load_cont, load_generic = function(selector, target, getInfo, postLoad) {
    return function() {
        var a = $(this).find("a");
        var filename = a.attr('href');
        var info = getInfo ? getInfo(a) : null;
        var button = a.parent();
        button.text('... loading ...');
        (target ? target(button) : button).load(filename + " " + selector, function() {
            // https://stackoverflow.com/a/8452751/946226
            var elems = $(this).children(':first').unwrap();
            // set this behaviour for the next link too
            var td = elems.parent().find(".ondemand td");
            td.on('click', load_cont);
            postLoad ? postLoad(td, info) : null;
        });
        return false;
    };
  };
  load_cont = load_generic("tr", function(x) { return x.parent(); }, function(a) {
    var textparts = /^(.*)\((\d+) pieces?(.*)\)$/.exec(a.text());
    var numleft = Number.parseInt(textparts[2]) - 1;
    var noun = numleft == 1 ? "piece" : "pieces";
    return textparts[1] + "(" + numleft + " " + noun + textparts[3] + ")";
  }, function(td, info) { td.find("a").text(info); });
  $(".ondemand td").on('click', load_cont);
  $(".ondemand-details").on('click', load_generic("div.difference > *"));
  // activate [+]/[-] controls
  var diffcontrols = $(".diffcontrol");
  $(".diffheader").on('click', function(evt) {
    var control = $(this).find(".diffcontrol");
    var parent = control.parent();
    var target = parent.siblings('table.diff, div.difference, div.comment');
    var orig = target;
    if (evt.shiftKey) {
        var gparent = parent.parent();
        target = gparent.find('table.diff, div.comment, div.difference');
        control = target.parent().not(gparent).find('.diffcontrol');
    }
    if (orig.is(":visible")) {
        target.hide();
        control.text("⊞");
    } else {
        target.show();
        control.text("⊟");
    }
  });
  diffcontrols.attr('title','shift-click to show/hide all children too.');
  diffcontrols.show();
  $(".diffcontrol-nochildren").show();
});
</script>
<style type="text/css">
.diffoscope table.diff tr.ondemand td, .diffoscope div.ondemand-details {
  background: #f99;
  text-align: center;
  padding: 0.5em 0;
}
.diffoscope table.diff tr.ondemand:hover td, .diffoscope div.ondemand-details:hover {
  background: #faa;
  cursor: pointer;
}
.diffoscope .diffheader {
  cursor: pointer;
}
.diffoscope .diffheader:hover .diffcontrol {
  color: #080;
  font-weight: bold;
}
.diffoscope .diffcontrol-double {
  line-height: 250%%;
}
</style>
"""

DIFFNODE_LAZY_LOAD = u"""<div class="ondemand-details" title="the size refers to the raw diff and includes all children;
only the top %(pagesize)s of the HTML are loaded at a time">... <a
href="%(pagename)s.html">load details (total %(size)s)</a> ...</div>
"""

DIFFNODE_LIMIT = u"""<div class="error">Max report size reached</div>
"""

UD_TABLE_HEADER = u"""<table class="diff">
<colgroup><col class="colines"/><col class="coldiff"/>
<col class="colines"/><col class="coldiff"/></colgroup>
"""

UD_TABLE_FOOTER = u"""<tr class="ondemand"><td colspan="4">
... <a href="%(filename)s">%(text)s</a> ...
</td></tr>
"""

UD_TABLE_LIMIT_FOOTER = u"""<tr class="error"><td colspan="4">
Max %(limit_type)s reached; %(bytes_left)s/%(bytes_total)s bytes (%(percent).2f%%) of diff not shown.
</td></tr>"""