Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / server2 / api_models.py
index b5686a1..1875a1e 100644 (file)
@@ -45,7 +45,7 @@ class APIModels(object):
     # Callers sometimes specify a filename which includes .json or .idl - if
     # so, believe them. They may even include the 'api/' prefix.
     if os.path.splitext(api_name)[1] in ('.json', '.idl'):
-      if not api_name.startswith(API + '/'):
+      if not api_name.startswith(API):
         api_name = posixpath.join(API, api_name)
       return self._model_cache.GetFromFile(api_name)
 
@@ -62,7 +62,8 @@ class APIModels(object):
           'devtools', file_name.replace(basename,
                                         basename.replace('devtools_' , '')))
 
-    futures = [self._model_cache.GetFromFile('%s/%s.%s' % (API, file_name, ext))
+    futures = [self._model_cache.GetFromFile(
+                   posixpath.join(API, '%s.%s' % (file_name, ext)))
                for ext in ('json', 'idl')]
     def resolve():
       for future in futures: