1183d6f817
Python 3 was released more than 10 years ago, and support for Python 2 is going away, with many Linux distributions starting to phase it out. This patch migrates git-arr to Python 3. The generated output is almost exactly the same, there are some minor differences such as HTML characters being quoted more aggresively, and handling of paths with non-utf8 values.
17 lines
548 B
HTML
17 lines
548 B
HTML
<table class="nice toggable ls" id="ls">
|
|
% key_func = lambda x: (x[0] != 'tree', x[1].raw)
|
|
% for type, name, size in sorted(tree.ls(dirname.raw), key = key_func):
|
|
<tr class="{{type}}">
|
|
% if type == "blob":
|
|
<td class="name"><a href="{{treeroot}}/f={{name.url}}.html">
|
|
{{!name.html}}</a></td>
|
|
<td class="size">{{size}}</td>
|
|
% elif type == "tree":
|
|
<td class="name">
|
|
<a class="explicit" href="{{treeroot}}/{{name.url}}/">
|
|
{{!name.html}}/</a></td>
|
|
% end
|
|
</tr>
|
|
% end
|
|
</table>
|