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

Side by Side Diff: third_party/py_vulcanize/py_vulcanize/html_generation_controller.py

Issue 1376953005: Move tracing/third_party/tvcm -> third_party/py_vulcanize. (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Created 5 years, 2 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 os 5 import os
6 import re 6 import re
7 from tvcm import style_sheet 7 from py_vulcanize import style_sheet
8 8
9 9
10 class HTMLGenerationController(object): 10 class HTMLGenerationController(object):
11 11
12 def __init__(self): 12 def __init__(self):
13 self.current_module = None 13 self.current_module = None
14 14
15 def GetHTMLForStylesheetHRef(self, href): # pylint: disable=unused-argument 15 def GetHTMLForStylesheetHRef(self, href): # pylint: disable=unused-argument
16 return None 16 return None
17 17
18 def GetHTMLForInlineStylesheet(self, contents): 18 def GetHTMLForInlineStylesheet(self, contents):
19 if self.current_module is None: 19 if self.current_module is None:
20 if re.search('url\(.+\)', contents): 20 if re.search('url\(.+\)', contents):
21 raise Exception( 21 raise Exception(
22 'Default HTMLGenerationController cannot handle inline style urls') 22 'Default HTMLGenerationController cannot handle inline style urls')
23 return contents 23 return contents
24 24
25 module_dirname = os.path.dirname(self.current_module.resource.absolute_path) 25 module_dirname = os.path.dirname(self.current_module.resource.absolute_path)
26 ss = style_sheet.ParsedStyleSheet( 26 ss = style_sheet.ParsedStyleSheet(
27 self.current_module.loader, module_dirname, contents) 27 self.current_module.loader, module_dirname, contents)
28 return ss.contents_with_inlined_images 28 return ss.contents_with_inlined_images
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698