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

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

Issue 437323003: Docserver: Factor SamplesModel out of SamplesDataSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/caching_file_system.py
diff --git a/chrome/common/extensions/docs/server2/caching_file_system.py b/chrome/common/extensions/docs/server2/caching_file_system.py
index 59d8030c33af19dbdf04f0c092ad32d776009f3b..261c7e34f45657cd3df89a7dc6370a40739eee3b 100644
--- a/chrome/common/extensions/docs/server2/caching_file_system.py
+++ b/chrome/common/extensions/docs/server2/caching_file_system.py
@@ -7,7 +7,7 @@ import sys
from file_system import FileSystem, StatInfo, FileNotFoundError
from future import Future
-from path_util import IsDirectory
+from path_util import IsDirectory, ToDirectory
from third_party.json_schema_compiler.memoize import memoize
@@ -43,8 +43,7 @@ class CachingFileSystem(FileSystem):
# Always stat the parent directory, since it will have the stat of the child
# anyway, and this gives us an entire directory's stat info at once.
dir_path, file_path = posixpath.split(path)
- if dir_path and not dir_path.endswith('/'):
- dir_path += '/'
+ dir_path = ToDirectory(dir_path)
ahernandez 2014/08/04 20:40:02 I had to add a few of these because the path '' wa
def make_stat_info(dir_stat):
'''Converts a dir stat into the correct resulting StatInfo; if the Stat

Powered by Google App Engine
This is Rietveld 408576698