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..f1eeb30334aca34468198a6f4051266d632e029d |
--- /dev/null |
+++ b/chrome/common/extensions/docs/server2/template_utility.py |
@@ -0,0 +1,14 @@ |
+# 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 |
+ |
+from third_party.handlebar import Handlebar |
+ |
+class TemplateUtility(object): |
+ def RenderTemplate(self, template_source, json_str): |
+ template = Handlebar(template_source) |
+ rendered_template = template.render(json.loads(json_str), |
+ {'templates': []}).text |
+ return rendered_template |
not at google - send to devlin
2012/06/04 04:37:08
nit: we'll probably want to do something with the
Aaron Boodman
2012/06/04 06:29:09
This makes sense because we're going to end up wit
not at google - send to devlin
2012/06/04 06:36:29
Within each process is certainly a lot better than
|