From aee18d0edd88b9db07c3cfb5c13d9889ffac94c1 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 24 May 2020 15:52:11 +0100 Subject: Simplify smstr With the Python 2 to 3 migration and the type checking, we can be fairly confident that smstr are always constructed from strings, not bytes. This allows the code to be simplified, as we no longer need to carry the dual raw/unicode representation. --- views/blob.html | 10 +++++----- views/tree.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'views') diff --git a/views/blob.html b/views/blob.html index 58c40a7..f1c6ad0 100644 --- a/views/blob.html +++ b/views/blob.html @@ -10,7 +10,7 @@ % relroot = reltree + '../' * (len(branch.split('/')) - 1) git » {{repo.name}} » - {{branch}} » {{dirname.unicode}}{{fname.unicode}} + {{branch}} » {{dirname.raw}}{{fname.raw}} {{c.unicode}} / + {{c.raw}} / % base += c + '/' % end {{!fname.html}} @@ -45,7 +45,7 @@ empty — 0 bytes -% elif can_embed_image(repo, fname.unicode): +% elif can_embed_image(repo, fname.raw): {{!embed_image_blob(fname.raw, blob.raw_content)}} % elif is_binary(blob.raw_content): @@ -72,12 +72,12 @@ % end
-% elif can_markdown(repo, fname.unicode): +% elif can_markdown(repo, fname.raw):
{{!markdown_blob(blob.utf8_content)}}
% elif can_colorize(blob.utf8_content): -{{!colorize_blob(fname.unicode, blob.utf8_content)}} +{{!colorize_blob(fname.raw, blob.utf8_content)}} % else:
 {{blob.utf8_content}}
diff --git a/views/tree.html b/views/tree.html
index 3f3829c..179672d 100644
--- a/views/tree.html
+++ b/views/tree.html
@@ -10,7 +10,7 @@
 % relroot = reltree + '../' * (len(branch.split('/')) - 1)
 
 git » {{repo.name}} »
-    {{branch}} » {{dirname.unicode if dirname.unicode else '/'}}
+    {{branch}} » {{dirname.raw if dirname.raw else '/'}}
 
 
@@ -31,7 +31,7 @@
 %   if not c.raw:
 %     continue
 %   end
-    {{c.unicode}} /
+    {{c.raw}} /
 %   base += c + '/'
 % end
 
-- 
cgit v1.2.3