File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def get_terminal_size():
2121
2222def paginate_file (file_path ):
2323 lines_per_page = get_terminal_size () - 1
24- with open (file_path , 'r' ) as file :
24+ with open (file_path , 'r' , encoding = 'utf8' ) as file :
2525 lines = file .readlines ()
2626
2727 for i in range (0 , len (lines ), lines_per_page ):
@@ -103,8 +103,10 @@ def main():
103103 data_path = os .path .join (base_path , 'LICENSES' )
104104 print (f"*** { _PKG_NAME } open source license notice ***" )
105105 for ff in os .listdir (data_path ):
106- f = open (os .path .join (data_path , ff ), 'r' , encoding = 'utf8' )
107- print (f .read ())
106+ source_file = os .path .join (data_path , ff )
107+ destination_file = os .path .join (base_path , ff )
108+ paginate_file (source_file )
109+ shutil .copyfile (source_file , destination_file )
108110 sys .exit (0 )
109111
110112 timer = TimerThread ()
You can’t perform that action at this time.
0 commit comments