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

Side by Side Diff: chrome/common/extensions/docs/server2/subversion_file_system.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments - Patch currently being broken up Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging
6 import re 5 import re
7 import posixpath 6 import posixpath
8 import xml.dom.minidom as xml 7 import xml.dom.minidom as xml
9 from xml.parsers.expat import ExpatError 8 from xml.parsers.expat import ExpatError
10 9
11 from appengine_url_fetcher import AppEngineUrlFetcher 10 from appengine_url_fetcher import AppEngineUrlFetcher
11 from appengine_wrappers import GetAppVersion
12 from caching_file_system import CachingFileSystem
12 from docs_server_utils import StringIdentity 13 from docs_server_utils import StringIdentity
13 from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode 14 from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode
14 from future import Future 15 from future import Future
16 from object_store_creator import ObjectStoreCreator
15 import svn_constants 17 import svn_constants
18 from third_party.json_schema_compiler.memoize import memoize
16 import url_constants 19 import url_constants
17 20
18 class _AsyncFetchFuture(object): 21 class _AsyncFetchFuture(object):
19 def __init__(self, paths, fetcher, binary, args=None): 22 def __init__(self, paths, fetcher, binary, args=None):
20 def apply_args(path): 23 def apply_args(path):
21 return path if args is None else '%s?%s' % (path, args) 24 return path if args is None else '%s?%s' % (path, args)
22 # A list of tuples of the form (path, Future). 25 # A list of tuples of the form (path, Future).
23 self._fetches = [(path, fetcher.FetchAsync(apply_args(path))) 26 self._fetches = [(path, fetcher.FetchAsync(apply_args(path)))
24 for path in paths] 27 for path in paths]
25 self._value = {} 28 self._value = {}
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if path.endswith('/'): 165 if path.endswith('/'):
163 return stat_info 166 return stat_info
164 if filename not in stat_info.child_versions: 167 if filename not in stat_info.child_versions:
165 raise FileNotFoundError('%s was not in child versions' % filename) 168 raise FileNotFoundError('%s was not in child versions' % filename)
166 return StatInfo(stat_info.child_versions[filename]) 169 return StatInfo(stat_info.child_versions[filename])
167 170
168 def GetIdentity(self): 171 def GetIdentity(self):
169 # NOTE: no revision here, consider it just an implementation detail of the 172 # NOTE: no revision here, consider it just an implementation detail of the
170 # file version that is handled by Stat. 173 # file version that is handled by Stat.
171 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path))) 174 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698