@@ -49,18 +49,18 @@ class FrameworkInfo(object):
49
49
return False
50
50
51
51
def __str__ (self ):
52
- return """ Framework name: %s
53
- Framework directory: %s
54
- Framework path: %s
55
- Binary name: %s
56
- Binary directory: %s
57
- Binary path: %s
58
- Version: %s
59
- Install name: %s
60
- Deployed install name: %s
61
- Source file Path: %s
62
- Deployed Directory (relative to bundle): %s
63
- """ % (self .frameworkName ,
52
+ return """ Framework name: {}
53
+ Framework directory: {}
54
+ Framework path: {}
55
+ Binary name: {}
56
+ Binary directory: {}
57
+ Binary path: {}
58
+ Version: {}
59
+ Install name: {}
60
+ Deployed install name: {}
61
+ Source file Path: {}
62
+ Deployed Directory (relative to bundle): {}
63
+ """ . format (self .frameworkName ,
64
64
self .frameworkDirectory ,
65
65
self .frameworkPath ,
66
66
self .binaryName ,
@@ -182,8 +182,8 @@ class DeploymentInfo(object):
182
182
self .pluginPath = pluginPath
183
183
184
184
def usesFramework (self , name : str ) -> bool :
185
- nameDot = "%s." % name
186
- libNameDot = "lib%s." % name
185
+ nameDot = "{}." . format ( name )
186
+ libNameDot = "lib{}." . format ( name )
187
187
for framework in self .deployedFrameworks :
188
188
if framework .endswith (".framework" ):
189
189
if framework .startswith (nameDot ):
@@ -203,7 +203,7 @@ def getFrameworks(binaryPath: str, verbose: int) -> List[FrameworkInfo]:
203
203
if verbose >= 1 :
204
204
sys .stderr .write (o_stderr )
205
205
sys .stderr .flush ()
206
- raise RuntimeError ("otool failed with return code %d" % otool .returncode )
206
+ raise RuntimeError ("otool failed with return code {}" . format ( otool .returncode ) )
207
207
208
208
otoolLines = o_stdout .split ("\n " )
209
209
otoolLines .pop (0 ) # First line is the inspected binary
@@ -359,7 +359,7 @@ def deployFrameworks(frameworks: List[FrameworkInfo], bundlePath: str, binaryPat
359
359
def deployFrameworksForAppBundle (applicationBundle : ApplicationBundleInfo , strip : bool , verbose : int ) -> DeploymentInfo :
360
360
frameworks = getFrameworks (applicationBundle .binaryPath , verbose )
361
361
if len (frameworks ) == 0 and verbose >= 1 :
362
- print ("Warning: Could not find any external frameworks to deploy in %s." % (applicationBundle .path ))
362
+ print ("Warning: Could not find any external frameworks to deploy in {}." . format (applicationBundle .path ))
363
363
return DeploymentInfo ()
364
364
else :
365
365
return deployFrameworks (frameworks , applicationBundle .path , applicationBundle .binaryPath , strip , verbose )
@@ -500,7 +500,7 @@ app_bundle = config.app_bundle[0]
500
500
501
501
if not os .path .exists (app_bundle ):
502
502
if verbose >= 1 :
503
- sys .stderr .write ("Error: Could not find app bundle \" %s \" \n " % (app_bundle ))
503
+ sys .stderr .write ("Error: Could not find app bundle \" {} \" \n " . format (app_bundle ))
504
504
sys .exit (1 )
505
505
506
506
app_bundle_name = os .path .splitext (os .path .basename (app_bundle ))[0 ]
@@ -512,7 +512,7 @@ if config.translations_dir and config.translations_dir[0]:
512
512
translations_dir = config .translations_dir [0 ]
513
513
else :
514
514
if verbose >= 1 :
515
- sys .stderr .write ("Error: Could not find translation dir \" %s \" \n " % (translations_dir ))
515
+ sys .stderr .write ("Error: Could not find translation dir \" {} \" \n " . format (translations_dir ))
516
516
sys .exit (1 )
517
517
# ------------------------------------------------
518
518
@@ -521,7 +521,7 @@ for p in config.add_resources:
521
521
print ("Checking for \" %s\" ..." % p )
522
522
if not os .path .exists (p ):
523
523
if verbose >= 1 :
524
- sys .stderr .write ("Error: Could not find additional resource file \" %s \" \n " % (p ))
524
+ sys .stderr .write ("Error: Could not find additional resource file \" {} \" \n " . format (p ))
525
525
sys .exit (1 )
526
526
527
527
# ------------------------------------------------
@@ -538,17 +538,17 @@ if len(config.fancy) == 1:
538
538
539
539
p = config .fancy [0 ]
540
540
if verbose >= 3 :
541
- print ("Fancy: Loading \" %s \" ..." % p )
541
+ print ("Fancy: Loading \" {} \" ..." . format ( p ) )
542
542
if not os .path .exists (p ):
543
543
if verbose >= 1 :
544
- sys .stderr .write ("Error: Could not find fancy disk image plist at \" %s \" \n " % (p ))
544
+ sys .stderr .write ("Error: Could not find fancy disk image plist at \" {} \" \n " . format (p ))
545
545
sys .exit (1 )
546
546
547
547
try :
548
548
fancy = plistlib .readPlist (p )
549
549
except :
550
550
if verbose >= 1 :
551
- sys .stderr .write ("Error: Could not parse fancy disk image plist at \" %s \" \n " % (p ))
551
+ sys .stderr .write ("Error: Could not parse fancy disk image plist at \" {} \" \n " . format (p ))
552
552
sys .exit (1 )
553
553
554
554
try :
@@ -562,18 +562,18 @@ if len(config.fancy) == 1:
562
562
assert isinstance (value , list ) and len (value ) == 2 and isinstance (value [0 ], int ) and isinstance (value [1 ], int )
563
563
except :
564
564
if verbose >= 1 :
565
- sys .stderr .write ("Error: Bad format of fancy disk image plist at \" %s \" \n " % (p ))
565
+ sys .stderr .write ("Error: Bad format of fancy disk image plist at \" {} \" \n " . format (p ))
566
566
sys .exit (1 )
567
567
568
568
if "background_picture" in fancy :
569
569
bp = fancy ["background_picture" ]
570
570
if verbose >= 3 :
571
- print ("Fancy: Resolving background picture \" %s \" ..." % bp )
571
+ print ("Fancy: Resolving background picture \" {} \" ..." . format ( bp ) )
572
572
if not os .path .exists (bp ):
573
573
bp = os .path .join (os .path .dirname (p ), bp )
574
574
if not os .path .exists (bp ):
575
575
if verbose >= 1 :
576
- sys .stderr .write ("Error: Could not find background picture at \" %s \" or \" %s \" \n " % (fancy ["background_picture" ], bp ))
576
+ sys .stderr .write ("Error: Could not find background picture at \" {} \" or \" {} \" \n " . format (fancy ["background_picture" ], bp ))
577
577
sys .exit (1 )
578
578
else :
579
579
fancy ["background_picture" ] = bp
624
624
config .plugins = False
625
625
except RuntimeError as e :
626
626
if verbose >= 1 :
627
- sys .stderr .write ("Error: %s \n " % str (e ))
627
+ sys .stderr .write ("Error: {} \n " . format ( str (e ) ))
628
628
sys .exit (1 )
629
629
630
630
# ------------------------------------------------
@@ -637,7 +637,7 @@ if config.plugins:
637
637
deployPlugins (applicationBundle , deploymentInfo , config .strip , verbose )
638
638
except RuntimeError as e :
639
639
if verbose >= 1 :
640
- sys .stderr .write ("Error: %s \n " % str (e ))
640
+ sys .stderr .write ("Error: {} \n " . format ( str (e ) ))
641
641
sys .exit (1 )
642
642
643
643
# ------------------------------------------------
@@ -653,14 +653,14 @@ else:
653
653
else :
654
654
sys .stderr .write ("Error: Could not find Qt translation path\n " )
655
655
sys .exit (1 )
656
- add_qt_tr = ["qt_%s .qm" % lng for lng in config .add_qt_tr [0 ].split ("," )]
656
+ add_qt_tr = ["qt_{} .qm" . format ( lng ) for lng in config .add_qt_tr [0 ].split ("," )]
657
657
for lng_file in add_qt_tr :
658
658
p = os .path .join (qt_tr_dir , lng_file )
659
659
if verbose >= 3 :
660
- print ("Checking for \" %s \" ..." % p )
660
+ print ("Checking for \" {} \" ..." . format ( p ) )
661
661
if not os .path .exists (p ):
662
662
if verbose >= 1 :
663
- sys .stderr .write ("Error: Could not find Qt translation file \" %s \" \n " % (lng_file ))
663
+ sys .stderr .write ("Error: Could not find Qt translation file \" {} \" \n " . format (lng_file ))
664
664
sys .exit (1 )
665
665
666
666
# ------------------------------------------------
@@ -701,8 +701,8 @@ if config.sign and 'CODESIGNARGS' not in os.environ:
701
701
print ("You must set the CODESIGNARGS environment variable. Skipping signing." )
702
702
elif config .sign :
703
703
if verbose >= 1 :
704
- print ("Code-signing app bundle %s" % (target , ))
705
- subprocess .check_call ("codesign --force %s %s" % (os .environ ['CODESIGNARGS' ], target ), shell = True )
704
+ print ("Code-signing app bundle {}" . format (target ))
705
+ subprocess .check_call ("codesign --force {} {}" . format (os .environ ['CODESIGNARGS' ], target ), shell = True )
706
706
707
707
# ------------------------------------------------
708
708
0 commit comments