| 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)
|
|
|