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

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

Issue 165353004: Docserver: Fix invalid path usage in CloudStorageFileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « chrome/common/extensions/docs/server2/gcs_file_system.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/path_util.py
diff --git a/chrome/common/extensions/docs/server2/path_util.py b/chrome/common/extensions/docs/server2/path_util.py
index 06fa75e5294a49df16a0bcfc368f7fa1e50d78a5..fa9db48553dc82f86a333aa9171b48fb88dd8d66 100644
--- a/chrome/common/extensions/docs/server2/path_util.py
+++ b/chrome/common/extensions/docs/server2/path_util.py
@@ -29,6 +29,11 @@ def AssertIsValid(path):
assert IsValid(path), 'Path "%s" is invalid' % path
+def Join(*paths):
+ assert all(IsValid(path) for path in paths), paths
+ return posixpath.join(*paths)
+
+
def SplitParent(path):
'''Returns the parent directory and base name of |path| in a tuple.
Any trailing slash of |path| is preserved, such that the parent of
« no previous file with comments | « chrome/common/extensions/docs/server2/gcs_file_system.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698