Adding the orphaned options pages to the navigation
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / file_system_util.py
blob0882564719713f847d67ed9cf0dd4e69922cf1bd
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import posixpath
7 def CreateURLsFromPaths(file_system, directory, urlprefix):
8 '''Yields a tuple (url, prefix) for every file in |directory|, where the URL
9 is given relative to |urlprefix|.
10 '''
11 for root, _, files in file_system.Walk(directory):
12 for f in files:
13 url = posixpath.join(urlprefix, root, f)
14 yield url, posixpath.join(directory, root, f)