Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / server2 / content_provider.py
index 84e3d2c..96281cf 100644 (file)
@@ -2,7 +2,6 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import logging
 import mimetypes
 import posixpath
 import traceback
@@ -15,8 +14,8 @@ from future import All, Future
 from path_canonicalizer import PathCanonicalizer
 from path_util import AssertIsValid, IsDirectory, Join, ToDirectory
 from special_paths import SITE_VERIFICATION_FILE
-from third_party.handlebar import Handlebar
 from third_party.markdown import markdown
+from third_party.motemplate import Motemplate
 
 
 _MIMETYPE_OVERRIDES = {
@@ -42,7 +41,7 @@ class ContentProvider(object):
 
   Typically the file contents will be either str (for binary content) or
   unicode (for text content). However, HTML files *may* be returned as
-  Handlebar templates (if |supports_templates| is True on construction), in
+  Motemplate templates (if |supports_templates| is True on construction), in
   which case the caller will presumably want to Render them.
 
   Zip file are automatically created and returned for .zip file extensions if
@@ -89,7 +88,7 @@ class ContentProvider(object):
       content = markdown(ToUnicode(text),
                          extensions=('extra', 'headerid', 'sane_lists'))
       if self._supports_templates:
-        content = Handlebar(content, name=path)
+        content = Motemplate(content, name=path)
       mimetype = 'text/html'
     elif mimetype is None:
       content = text
@@ -97,7 +96,7 @@ class ContentProvider(object):
     elif mimetype == 'text/html':
       content = ToUnicode(text)
       if self._supports_templates:
-        content = Handlebar(content, name=path)
+        content = Motemplate(content, name=path)
     elif (mimetype.startswith('text/') or
           mimetype in ('application/javascript', 'application/json')):
       content = ToUnicode(text)
@@ -196,8 +195,8 @@ class ContentProvider(object):
             .Then(lambda found: found or find_index_file())
             .Then(lambda found: found or path))
 
-  def Cron(self):
-    futures = [self._path_canonicalizer.Cron()]
+  def Refresh(self):
+    futures = [self._path_canonicalizer.Refresh()]
     for root, _, files in self.file_system.Walk(''):
       for f in files:
         futures.append(self.GetContentAndType(Join(root, f)))