@@ -533,7 +533,7 @@ def build(self, projects):
533
533
if self .opts .check_hash :
534
534
return
535
535
536
- # List of all the project we can mark for build because of a dependend
536
+ # List of all the project we can mark for build because of a dependent
537
537
self .prj_to_mark = [x for x in Project ._projects if x .is_project ()]
538
538
539
539
self .prj_done = []
@@ -551,11 +551,7 @@ def build(self, projects):
551
551
if self .__build_one (p ):
552
552
self .prj_skipped .append (p .name )
553
553
else :
554
- msg = "%-*s (%.3f s)" % (
555
- Project .name_len ,
556
- p .name ,
557
- time .time () - st ,
558
- )
554
+ msg = f"{ p .name :{Project .name_len }} ({ time .time () - st :.3f} )"
559
555
self .prj_done .append (msg )
560
556
except KeyboardInterrupt :
561
557
traceback .print_exc ()
@@ -597,8 +593,7 @@ def build(self, projects):
597
593
log .message (f" { p } " )
598
594
miss += len (self .prj_dropped )
599
595
600
- # Don't fool appveyor
601
- log .error_exit ("%u project(s) missing ;(" % (miss ,))
596
+ log .error_exit ("%d project(s) missing ;(" )
602
597
603
598
log .close ()
604
599
@@ -798,21 +793,14 @@ def __download_progress(self, count, block_size, total_size):
798
793
if perc != self ._old_perc :
799
794
perc = min (perc , 100 )
800
795
self ._old_perc = perc
801
- sp = "%s (%u k) - %u%%" % (
802
- self ._downloading_file ,
803
- total_size / 1024 ,
804
- self ._old_perc ,
805
- )
796
+ sp = f"{ self ._downloading_file } ({ total_size / 1024 } k) - { self ._old_perc :.0f} %"
806
797
print (sp , end = "\r " )
807
798
if len (sp ) > self ._old_print :
808
799
# Save the len to delete the line when we change file
809
800
self ._old_print = len (sp )
810
801
else :
811
802
# Only the current, we don't know the size
812
- sp = "%s - %u k" % (
813
- self ._downloading_file ,
814
- c_size / 1024 ,
815
- )
803
+ sp = f"{ self ._downloading_file } - { c_size / 1024 :.0f} k"
816
804
print (sp , end = "\r " )
817
805
if len (sp ) > self ._old_print :
818
806
self ._old_print = len (sp )
@@ -837,14 +825,7 @@ def urlretrieve(self, url, filename, reporthook, ssl_ignore_cert=False):
837
825
msg = f"Opening { url } ..."
838
826
print (msg , end = "\r " )
839
827
with contextlib .closing (urlopen (url , None , context = ssl_ctx )) as fp :
840
- print (
841
- "%*s"
842
- % (
843
- len (msg ),
844
- "" ,
845
- ),
846
- end = "\r " ,
847
- )
828
+ print (f"{ '' :>{len (msg )}} " , end = "\r " )
848
829
headers = fp .info ()
849
830
850
831
with open (filename , "wb" ) as tfp :
@@ -870,7 +851,7 @@ def urlretrieve(self, url, filename, reporthook, ssl_ignore_cert=False):
870
851
871
852
if size >= 0 and read < size :
872
853
raise ContentTooShortError (
873
- "retrieval incomplete: got only %i out of %i bytes" % ( read , size ) ,
854
+ f "retrieval incomplete: got only { read } out of { size } bytes" ,
874
855
result ,
875
856
)
876
857
@@ -920,9 +901,7 @@ def __download_one(self, proj):
920
901
raise
921
902
log .end ()
922
903
923
- print (
924
- "%-*s" % (self ._old_print , f"{ proj .archive_file } - Download finished" ),
925
- )
904
+ print (f"{ proj .archive_file :{self ._old_print }} - Download finished" )
926
905
return self .__check_hash (proj )
927
906
928
907
def __sub_vars (self , s ):
0 commit comments