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

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

Issue 17816005: Doc server broken link detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finalization Created 7 years, 5 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/file_system_util.py
diff --git a/chrome/common/extensions/docs/server2/file_system_util.py b/chrome/common/extensions/docs/server2/file_system_util.py
new file mode 100644
index 0000000000000000000000000000000000000000..4431e58c2595cca67faa47cf3e46d59e8088fcee
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/file_system_util.py
@@ -0,0 +1,14 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import posixpath
+
+def CreateURLsFromPaths(file_system, directory, urlprefix):
+ '''Yields a tuple (url, prefix) for every file in |directory|, where the URL
+ is given relative to |urlprefix|.
+ '''
+ for root, _, files in file_system.Walk(directory):
+ for f in files:
+ url = posixpath.join(urlprefix, root[len(directory) + 1:], f)
+ yield url, '%s/%s' % (root, f)
« no previous file with comments | « chrome/common/extensions/docs/server2/cron_servlet.py ('k') | chrome/common/extensions/docs/server2/handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698