File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ def main():
5656 for fname in args .filename :
5757 filename = os .path .abspath (fname )
5858 if not os .path .isfile (filename ):
59- raise Exception ('File not found: %s ' % filename )
59+ raise Exception (f 'File not found: { filename } ' )
6060
6161 extension = os .path .splitext (filename )[1 ]
6262
6363 if extension .lower () != '.txt' :
64- log .warn ("Filename '%s ' does not have a '.txt' extension" , filename )
64+ log .warn (f "Filename '{ filename } ' does not have a '.txt' extension" )
6565
6666 # Parse the filename for the applicable information
6767 parts = os .path .basename (filename ).split ('_' )
@@ -70,9 +70,9 @@ def main():
7070 subsys = parts [- 3 ]
7171
7272 try :
73- int (seqid )
73+ seqid = int (seqid )
7474 except ValueError :
75- raise Exception ('Invalid filename "%s": . %s' % ( os .path .basename (filename ), __doc__ ) )
75+ raise Exception ('Invalid filename "{ os.path.basename(filename)}": . { __doc__}' )
7676
7777 sequence = seq .createSeq (filename , id = seqid )
7878
@@ -83,7 +83,7 @@ def main():
8383 binpath = sequence .binpath
8484 seqid = sequence .seqid
8585
86- log .info ("Writing %s (seqid=0x%04x )." , binpath , seqid )
86+ log .info (f "Writing { binpath } (seqid=0x{ seqid :04X } )." )
8787 sequence .writeBinary ()
8888
8989 exit = 0
You can’t perform that action at this time.
0 commit comments