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

Unified Diff: chrome/common/extensions/docs/server2/template_utility.py

Issue 10500004: Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added parens Created 8 years, 6 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
Index: chrome/common/extensions/docs/server2/template_utility.py
diff --git a/chrome/common/extensions/docs/server2/template_utility.py b/chrome/common/extensions/docs/server2/template_utility.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac3120e595e5d805981d0a30082a0fd664cd806f
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/template_utility.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import json
+
+class TemplateUtility(object):
+ def RenderTemplate(self, template, json_str, partials=None):
+ if partials is None:
+ partials = []
+ # TODO(cduvall) error handling
+ result = template.render(json.loads(json_str), {'templates': partials})
+ return result.text

Powered by Google App Engine
This is Rietveld 408576698