Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1723)

Unified Diff: appengine/components/components/template.py

Issue 2693953006: Isolate: Download files as their filename instead of hash (Closed)
Patch Set: Isolate: Download files as their filename instead of hash Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/isolate/handlers_frontend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/components/components/template.py
diff --git a/appengine/components/components/template.py b/appengine/components/components/template.py
index 7bc0b9831dab3c8a4f868e3629e5c78a5366e723..bbe75c624e7268d4dd6ab7b669fa527a705bf07a 100644
--- a/appengine/components/components/template.py
+++ b/appengine/components/components/template.py
@@ -25,6 +25,10 @@ NON_BREAKING_HYPHEN = u'\u2011'
### Private stuff.
+def _basename(filepath):
+ return os.path.basename(filepath)
+
+
def _datetimeformat(value, f='%Y-%m-%d %H:%M:%S'):
if not value:
return NON_BREAKING_HYPHEN + NON_BREAKING_HYPHEN
@@ -85,6 +89,7 @@ def _utf8(s):
# Filters available by default.
_DEFAULT_GLOBAL_FILTERS = {
+ 'basename': _basename,
'datetimeformat': _datetimeformat,
'encode_to_json': utils.encode_to_json,
'epochformat': _epochformat,
« no previous file with comments | « no previous file | appengine/isolate/handlers_frontend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698