Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit 2040cd2

Browse files
rodrigcrvagg
authored andcommitted
gyp: use print as a function, as specified in PEP 3105.
#1150 Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent abef93d commit 2040cd2

15 files changed

Lines changed: 64 additions & 53 deletions

‎gyp/pylib/gyp/MSVSSettings.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
The MSBuild schemas were also considered. They are typically found in the
1414
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
1515
"""
16+
1617
from __future__ importprint_function
1718

1819
importsys
@@ -463,8 +464,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
463464
try:
464465
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
465466
exceptValueErrorase:
466-
print(('Warning: while converting %s/%s to MSBuild, '
467-
'%s'% (msvs_tool_name, msvs_setting, e)), file=stderr)
467+
print('Warning: while converting %s/%s to MSBuild, '
468+
'%s'% (msvs_tool_name, msvs_setting, e), file=stderr)
468469
else:
469470
_ValidateExclusionSetting(msvs_setting,
470471
msvs_tool,
@@ -473,8 +474,8 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
473474
(msvs_tool_name, msvs_setting)),
474475
stderr)
475476
else:
476-
print(('Warning: unrecognized tool %s while converting to '
477-
'MSBuild.'%msvs_tool_name), file=stderr)
477+
print('Warning: unrecognized tool %s while converting to '
478+
'MSBuild.'%msvs_tool_name, file=stderr)
478479
returnmsbuild_settings
479480

480481

@@ -519,8 +520,8 @@ def _ValidateSettings(validators, settings, stderr):
519520
try:
520521
tool_validators[setting](value)
521522
exceptValueErrorase:
522-
print(('Warning: for %s/%s, %s'%
523-
(tool_name, setting, e)), file=stderr)
523+
print('Warning: for %s/%s, %s'%
524+
(tool_name, setting, e), file=stderr)
524525
else:
525526
_ValidateExclusionSetting(setting,
526527
tool_validators,
@@ -529,7 +530,7 @@ def _ValidateSettings(validators, settings, stderr):
529530
stderr)
530531

531532
else:
532-
print(('Warning: unrecognized tool %s'%tool_name), file=stderr)
533+
print('Warning: unrecognized tool %s'%(tool_name), file=stderr)
533534

534535

535536
# MSVS and MBuild names of the tools.

‎gyp/pylib/gyp/__init__.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
from __future__ importprint_function
8+
89
importcopy
910
importgyp.input
1011
importoptparse
@@ -227,12 +228,12 @@ def Noop(value):
227228
(action=='store_false'andnotvalue)):
228229
flags.append(opt)
229230
elifoptions.use_environmentandenv_name:
230-
print(('Warning: environment regeneration unimplemented '
231+
print('Warning: environment regeneration unimplemented '
231232
'for %s flag %r env_name %r'% (action, opt,
232-
env_name)), file=sys.stderr)
233+
env_name), file=sys.stderr)
233234
else:
234-
print(('Warning: regeneration unimplemented for action %r '
235-
'flag %r'% (action, opt)), file=sys.stderr)
235+
print('Warning: regeneration unimplemented for action %r '
236+
'flag %r'% (action, opt), file=sys.stderr)
236237

237238
returnflags
238239

‎gyp/pylib/gyp/generator/analyzer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
6262
then the "all" target includes "b1" and "b2".
6363
"""
64+
6465
from __future__ importprint_function
6566

6667
importgyp.common
@@ -292,8 +293,8 @@ def _WasBuildFileModified(build_file, data, files, toplevel_dir):
292293
_ToGypPath(gyp.common.UnrelativePath(include_file, build_file))
293294
if_ToLocalPath(toplevel_dir, rel_include_file) infiles:
294295
ifdebug:
295-
print('included gyp file modified, gyp_file=', build_file, \
296-
'included file=', rel_include_file)
296+
print('included gyp file modified, gyp_file=', build_file,
297+
'included file=', rel_include_file)
297298
returnTrue
298299
returnFalse
299300

@@ -485,11 +486,11 @@ def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
485486
(add_if_no_ancestorortarget.requires_build)) or
486487
(target.is_static_libraryandadd_if_no_ancestorand
487488
nottarget.is_or_has_linked_ancestor)):
488-
print('\t\tadding to compile targets', target.name, 'executable', \
489-
target.is_executable, 'added_to_compile_targets', \
490-
target.added_to_compile_targets, 'add_if_no_ancestor', \
491-
add_if_no_ancestor, 'requires_build', target.requires_build, \
492-
'is_static_library', target.is_static_library, \
489+
print('\t\tadding to compile targets', target.name, 'executable',
490+
target.is_executable, 'added_to_compile_targets',
491+
target.added_to_compile_targets, 'add_if_no_ancestor',
492+
add_if_no_ancestor, 'requires_build', target.requires_build,
493+
'is_static_library', target.is_static_library,
493494
'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor)
494495
result.add(target)
495496
target.added_to_compile_targets=True

‎gyp/pylib/gyp/generator/android.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -15,6 +14,8 @@
1514
# variables set potentially clash with other Android build system variables.
1615
# Try to avoid setting global variables where possible.
1716

17+
from __future__ importprint_function
18+
1819
importgyp
1920
importgyp.common
2021
importgyp.generator.makeasmake# Reuse global functions from make backend.
@@ -251,7 +252,7 @@ def WriteActions(self, actions, extra_sources, extra_outputs):
251252
dirs=set()
252253
foroutinoutputs:
253254
ifnotout.startswith('$'):
254-
print('WARNING: Action for target "%s" writes output to local path '
255+
print('WARNING: Action for target "%s" writes output to local path '
255256
'"%s".'% (self.target, out))
256257
dir=os.path.split(out)[0]
257258
ifdir:
@@ -356,7 +357,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs):
356357
dirs=set()
357358
foroutinoutputs:
358359
ifnotout.startswith('$'):
359-
print('WARNING: Rule for target %s writes output to local path %s'
360+
print('WARNING: Rule for target %s writes output to local path %s'
360361
% (self.target, out))
361362
dir=os.path.dirname(out)
362363
ifdir:
@@ -430,7 +431,7 @@ def WriteCopies(self, copies, extra_outputs):
430431
# $(gyp_shared_intermediate_dir). Note that we can't use an assertion
431432
# because some of the gyp tests depend on this.
432433
ifnotcopy['destination'].startswith('$'):
433-
print('WARNING: Copy rule for target %s writes output to '
434+
print('WARNING: Copy rule for target %s writes output to '
434435
'local path %s'% (self.target, copy['destination']))
435436

436437
# LocalPathify() calls normpath, stripping trailing slashes.
@@ -637,8 +638,8 @@ def ComputeOutputParts(self, spec):
637638
elifself.type=='none':
638639
target_ext='.stamp'
639640
elifself.type!='executable':
640-
print(("ERROR: What output file should be generated?",
641-
"type", self.type, "target", target))
641+
print("ERROR: What output file should be generated?",
642+
"type", self.type, "target", target)
642643

643644
ifself.type!='static_library'andself.type!='shared_library':
644645
target_prefix=spec.get('product_prefix', target_prefix)
@@ -1066,7 +1067,7 @@ def CalculateMakefilePath(build_file, base_name):
10661067
write_alias_target=write_alias_targets,
10671068
sdk_version=sdk_version)
10681069
ifandroid_moduleinandroid_modules:
1069-
print('ERROR: Android module names must be unique. The following '
1070+
print('ERROR: Android module names must be unique. The following '
10701071
'targets both generate Android module name %s.\n %s\n %s'%
10711072
(android_module, android_modules[android_module],
10721073
qualified_target))

‎gyp/pylib/gyp/generator/cmake.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
not be able to find the header file directories described in the generated
2828
CMakeLists.txt file.
2929
"""
30+
3031
from __future__ importprint_function
3132

3233
importmultiprocessing
@@ -640,8 +641,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
640641

641642
cmake_target_type=cmake_target_type_from_gyp_target_type.get(target_type)
642643
ifcmake_target_typeisNone:
643-
print('Target %s has unknown target type %s, skipping.'%
644-
( target_name, target_type ))
644+
print('Target %s has unknown target type %s, skipping.'%
645+
( target_name, target_type ))
645646
return
646647

647648
SetVariable(output, 'TARGET', target_name)
@@ -864,8 +865,8 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
864865
default_product_ext=generator_default_variables['SHARED_LIB_SUFFIX']
865866

866867
eliftarget_type!='executable':
867-
print(('ERROR: What output file should be generated?',
868-
'type', target_type, 'target', target_name))
868+
print('ERROR: What output file should be generated?',
869+
'type', target_type, 'target', target_name)
869870

870871
product_prefix=spec.get('product_prefix', default_product_prefix)
871872
product_name=spec.get('product_name', default_product_name)

‎gyp/pylib/gyp/generator/make.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2013 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
@@ -22,6 +21,8 @@
2221
# toplevel Makefile. It may make sense to generate some .mk files on
2322
# the side to keep the files readable.
2423

24+
from __future__ importprint_function
25+
2526
importos
2627
importre
2728
importsys
@@ -678,9 +679,8 @@ def _ValidateSourcesForOSX(spec, all_sources):
678679
error+=' %s: %s\n'% (basename, ' '.join(files))
679680

680681
iferror:
681-
print('static library %s has several files with the same basename:\n'%
682-
spec['target_name'] +error+'libtool on OS X will generate'+
683-
' warnings for them.')
682+
print(('static library %s has several files with the same basename:\n'%spec['target_name'])
683+
+error+'libtool on OS X will generate'+' warnings for them.')
684684
raiseGypError('Duplicate basenames in sources section, see list above')
685685

686686

@@ -1382,8 +1382,8 @@ def ComputeOutputBasename(self, spec):
13821382
elifself.type=='none':
13831383
target='%s.stamp'%target
13841384
elifself.type!='executable':
1385-
print(("ERROR: What output file should be generated?",
1386-
"type", self.type, "target", target))
1385+
print("ERROR: What output file should be generated?",
1386+
"type", self.type, "target", target)
13871387

13881388
target_prefix=spec.get('product_prefix', target_prefix)
13891389
target=spec.get('product_name', target)

‎gyp/pylib/gyp/generator/msvs.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
importcopy
78
importntpath
89
importos
@@ -756,8 +757,8 @@ def _Replace(match):
756757
# the VCProj but cause the same problem on the final command-line. Moving
757758
# the item to the end of the list does works, but that's only possible if
758759
# there's only one such item. Let's just warn the user.
759-
print(('Warning: MSVS may misinterpret the odd number of '+
760-
'quotes in '+s), file=sys.stderr)
760+
print('Warning: MSVS may misinterpret the odd number of '+
761+
'quotes in '+s, file=sys.stderr)
761762
returns
762763

763764

@@ -975,8 +976,8 @@ def _ValidateSourcesForMSVSProject(spec, version):
975976
error+=' %s: %s\n'% (basename, ' '.join(files))
976977

977978
iferror:
978-
print('static library %s has several files with the same basename:\n'%
979-
spec['target_name'] +error+'MSVC08 cannot handle that.')
979+
print('static library %s has several files with the same basename:\n'%spec['target_name']
980+
+error+'MSVC08 cannot handle that.')
980981
raiseGypError('Duplicate basenames in sources section, see list above')
981982

982983

@@ -3028,7 +3029,7 @@ def _FinalizeMSBuildSettings(spec, configuration):
30283029
forignored_settinginignored_settings:
30293030
value=configuration.get(ignored_setting)
30303031
ifvalue:
3031-
print('Warning: The automatic conversion to MSBuild does not handle '
3032+
print('Warning: The automatic conversion to MSBuild does not handle '
30323033
'%s. Ignoring setting of %s'% (ignored_setting, str(value)))
30333034

30343035
defines= [_EscapeCppDefineForMSBuild(d) fordindefines]

‎gyp/pylib/gyp/input.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ importprint_function
21
# Copyright (c) 2012 Google Inc. All rights reserved.
32
# Use of this source code is governed by a BSD-style license that can be
43
# found in the LICENSE file.
54

5+
from __future__ importprint_function
6+
67
fromcompiler.astimportConst
78
fromcompiler.astimportDict
89
fromcompiler.astimportDiscard
@@ -2530,8 +2531,8 @@ def ValidateSourcesInTarget(target, target_dict, build_file,
25302531
error+=' %s: %s\n'% (basename, ' '.join(files))
25312532

25322533
iferror:
2533-
print('static library %s has several files with the same basename:\n'%
2534-
target+error+'libtool on Mac cannot handle that. Use '
2534+
print('static library %s has several files with the same basename:\n'%target
2535+
+error+'libtool on Mac cannot handle that. Use '
25352536
'--no-duplicate-basename-check to disable this validation.')
25362537
raiseGypError('Duplicate basenames in sources section, see list above')
25372538

‎gyp/pylib/gyp/mac_tool.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
These functions are executed via gyp-mac-tool when using the Makefile generator.
99
"""
10+
1011
from __future__ importprint_function
1112

1213
importfcntl
@@ -441,8 +442,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
441442
profiles_dir=os.path.join(
442443
os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles')
443444
ifnotos.path.isdir(profiles_dir):
444-
print((
445-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
445+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
446446
sys.exit(1)
447447
provisioning_profiles=None
448448
ifprofile:
@@ -463,8 +463,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
463463
valid_provisioning_profiles[app_id_pattern] = (
464464
profile_path, profile_data, team_identifier)
465465
ifnotvalid_provisioning_profiles:
466-
print((
467-
'cannot find mobile provisioning for %s'%bundle_identifier), file=sys.stderr)
466+
print('cannot find mobile provisioning for %s'% (bundle_identifier), file=sys.stderr)
468467
sys.exit(1)
469468
# If the user has multiple provisioning profiles installed that can be
470469
# used for ${bundle_identifier}, pick the most specific one (ie. the

‎gyp/pylib/gyp/win_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
These functions are executed via gyp-win-tool when using the ninja generator.
1010
"""
11+
1112
from __future__ importprint_function
1213

1314
importos

0 commit comments

Comments
 (0)