Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / server2 / api_categorizer.py
index 6a99133..5e1339e 100644 (file)
@@ -3,6 +3,8 @@
 # found in the LICENSE file.
 
 import os
+import posixpath
+
 from compiled_file_system import SingleFile
 from extensions_paths import PUBLIC_TEMPLATES
 
@@ -18,14 +20,14 @@ class APICategorizer(object):
                                              APICategorizer)
 
   def _GenerateAPICategories(self, platform):
-    return self._cache.GetFromFileListing('%s/%s' % (PUBLIC_TEMPLATES,
-                                                     platform)).Get()
+    return self._cache.GetFromFileListing(
+        posixpath.join(PUBLIC_TEMPLATES, platform) + '/').Get()
+
   @SingleFile
   def _CollectDocumentedAPIs(self, base_dir, files):
     public_templates = []
     for root, _, files in self._file_system.Walk(base_dir):
-      public_templates.extend(
-          ('%s/%s' % (root, name)).lstrip('/') for name in files)
+      public_templates.extend(posixpath.join(root, name) for name in files)
     template_names = set(os.path.splitext(name)[0].replace('_', '.')
                          for name in public_templates)
     return template_names
@@ -44,4 +46,4 @@ class APICategorizer(object):
     return 'chrome'
 
   def IsDocumented(self, platform, api_name):
-    return (api_name in self._GenerateAPICategories(platform))
\ No newline at end of file
+    return (api_name in self._GenerateAPICategories(platform))