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

Side by Side Diff: chrome/common/extensions/docs/server2/path_canonicalizer.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 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 import logging
6 import os 5 import os
7 from third_party.json_schema_compiler.model import UnixName 6 from third_party.json_schema_compiler.model import UnixName
8 import svn_constants 7 import svn_constants
9 8
10 class PathCanonicalizer(object): 9 class PathCanonicalizer(object):
11 '''Transforms paths into their canonical forms. Since the dev server has had 10 '''Transforms paths into their canonical forms. Since the dev server has had
12 many incarnations - e.g. there didn't use to be apps/ - there may be old 11 many incarnations - e.g. there didn't use to be apps/ - there may be old
13 paths lying around the webs. We try to redirect those to where they are now. 12 paths lying around the webs. We try to redirect those to where they are now.
14 ''' 13 '''
15 def __init__(self, channel, compiled_fs_factory): 14 def __init__(self, channel, compiled_fs_factory):
(...skipping 25 matching lines...) Expand all
41 apps_path = '%s/apps/%s' % (self._channel, path_without_channel) 40 apps_path = '%s/apps/%s' % (self._channel, path_without_channel)
42 extensions_path = '%s/extensions/%s' % (self._channel, 41 extensions_path = '%s/extensions/%s' % (self._channel,
43 path_without_channel) 42 path_without_channel)
44 43
45 unix_path = UnixName(os.path.splitext(path_without_channel)[0]) 44 unix_path = UnixName(os.path.splitext(path_without_channel)[0])
46 if unix_path in extensions_templates: 45 if unix_path in extensions_templates:
47 return extensions_path 46 return extensions_path
48 if unix_path in apps_templates: 47 if unix_path in apps_templates:
49 return apps_path 48 return apps_path
50 return extensions_path 49 return extensions_path
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698