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

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

Issue 575613003: Docserver: Gitiles auth and cron refactoring. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 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 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 from collections import defaultdict 5 from collections import defaultdict
6 import posixpath 6 import posixpath
7 7
8 from future import Future 8 from future import Future
9 from path_util import SplitParent 9 from path_util import SplitParent
10 from special_paths import SITE_VERIFICATION_FILE 10 from special_paths import SITE_VERIFICATION_FILE
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 # which may matter. 107 # which may matter.
108 max_prefix = potential_paths[0] 108 max_prefix = potential_paths[0]
109 max_prefix_length = len(_CommonNormalizedPrefix(max_prefix, path)) 109 max_prefix_length = len(_CommonNormalizedPrefix(max_prefix, path))
110 for path_for_file in potential_paths[1:]: 110 for path_for_file in potential_paths[1:]:
111 prefix_length = len(_CommonNormalizedPrefix(path_for_file, path)) 111 prefix_length = len(_CommonNormalizedPrefix(path_for_file, path))
112 if prefix_length > max_prefix_length: 112 if prefix_length > max_prefix_length:
113 max_prefix, max_prefix_length = path_for_file, prefix_length 113 max_prefix, max_prefix_length = path_for_file, prefix_length
114 114
115 return max_prefix 115 return max_prefix
116 116
117 def Cron(self): 117 def Refresh(self):
118 return self._LoadCache() 118 return self._LoadCache()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698