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

Side by Side Diff: ui/resources/PRESUBMIT.py

Issue 10875076: Add support for non-integer scaling factors in resource_scale_factors presubmit script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/theme/PRESUBMIT.py ('k') | ui/resources/resource_check/resource_scale_factors.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 """Presubmit script for Chromium UI resources. 5 """Presubmit script for Chromium UI resources.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl/git cl, and see 8 for more details about the presubmit API built into gcl/git cl, and see
9 http://www.chromium.org/developers/web-development-style-guide for the rules 9 http://www.chromium.org/developers/web-development-style-guide for the rules
10 we're checking against here. 10 we're checking against here.
11 """ 11 """
12 12
13 13
14 def CheckChangeOnUpload(input_api, output_api): 14 def CheckChangeOnUpload(input_api, output_api):
15 return _CommonChecks(input_api, output_api) 15 return _CommonChecks(input_api, output_api)
16 16
17 17
18 def CheckChangeOnCommit(input_api, output_api): 18 def CheckChangeOnCommit(input_api, output_api):
19 return _CommonChecks(input_api, output_api) 19 return _CommonChecks(input_api, output_api)
20 20
21 21
22 def _CommonChecks(input_api, output_api): 22 def _CommonChecks(input_api, output_api):
23 """Checks common to both upload and commit.""" 23 """Checks common to both upload and commit."""
24 results = [] 24 results = []
25 resources = input_api.PresubmitLocalPath() 25 resources = input_api.PresubmitLocalPath()
26 26
27 # List of paths with their associated scale factor. This is used to verify 27 # List of paths with their associated scale factor. This is used to verify
28 # that the images modified in one are the correct scale of the other. 28 # that the images modified in one are the correct scale of the other.
29 path_scales = [ 29 path_scales = [
30 [(1, 'default_100_percent/'), (2, 'default_200_percent/')], 30 [(100, 'default_100_percent/'), (200, 'default_200_percent/')],
31 ] 31 ]
32 32
33 import sys 33 import sys
34 old_path = sys.path 34 old_path = sys.path
35 35
36 try: 36 try:
37 sys.path = [resources] + old_path 37 sys.path = [resources] + old_path
38 from resource_check import resource_scale_factors 38 from resource_check import resource_scale_factors
39 39
40 for paths in path_scales: 40 for paths in path_scales:
41 results.extend(resource_scale_factors.ResourceScaleFactors( 41 results.extend(resource_scale_factors.ResourceScaleFactors(
42 input_api, output_api, paths).RunChecks()) 42 input_api, output_api, paths).RunChecks())
43 finally: 43 finally:
44 sys.path = old_path 44 sys.path = old_path
45 45
46 return results 46 return results
OLDNEW
« no previous file with comments | « chrome/app/theme/PRESUBMIT.py ('k') | ui/resources/resource_check/resource_scale_factors.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698