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

Side by Side Diff: chrome/app/theme/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: 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
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 theme resources. 5 """Presubmit script for Chromium theme 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.
(...skipping 10 matching lines...) Expand all
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.os_path.join(input_api.PresubmitLocalPath(), 25 resources = input_api.os_path.join(input_api.PresubmitLocalPath(),
26 '../../../ui/resources') 26 '../../../ui/resources')
27 27
28 # List of paths with their associated scale factor. This is used to verify 28 # List of paths with their associated scale factor. This is used to verify
29 # that the images modified in one are the correct scale of the other. 29 # that the images modified in one are the correct scale of the other.
30 path_scales = [ 30 path_scales = [
31 [(1, 'default_100_percent/'), (2, 'default_200_percent/')], 31 [(100, 'default_100_percent/'), (200, 'default_200_percent/')],
32 [(1, 'touch_100_percent/'), (2, 'touch_200_percent/')], 32 [(100, 'touch_100_percent/'), (200, 'touch_200_percent/')],
33 ] 33 ]
34 34
35 import sys 35 import sys
36 old_path = sys.path 36 old_path = sys.path
37 37
38 try: 38 try:
39 sys.path = [resources] + old_path 39 sys.path = [resources] + old_path
40 from resource_check import resource_scale_factors 40 from resource_check import resource_scale_factors
41 41
42 for paths in path_scales: 42 for paths in path_scales:
43 results.extend(resource_scale_factors.ResourceScaleFactors( 43 results.extend(resource_scale_factors.ResourceScaleFactors(
44 input_api, output_api, paths).RunChecks()) 44 input_api, output_api, paths).RunChecks())
45 finally: 45 finally:
46 sys.path = old_path 46 sys.path = old_path
47 47
48 return results 48 return results
OLDNEW
« no previous file with comments | « no previous file | ui/resources/PRESUBMIT.py » ('j') | ui/resources/resource_check/resource_scale_factors.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698