Skip to content

Commit

Permalink
Merge pull request #338 from NASA-AMMOS/issue-337
Browse files Browse the repository at this point in the history
Issue #337 - Update ait-seq-encode log message formatting
  • Loading branch information
MJJoyce authored Mar 23, 2021
2 parents 65b2ddf + 1359ac9 commit b8d3261
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ait/core/bin/ait_seq_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def main():
for fname in args.filename:
filename = os.path.abspath(fname)
if not os.path.isfile(filename):
raise Exception('File not found: %s ' % filename)
raise Exception(f'File not found: {filename}')

extension = os.path.splitext(filename)[1]

if extension.lower() != '.txt':
log.warn("Filename '%s' does not have a '.txt' extension", filename)
log.warn(f"Filename '{filename}' does not have a '.txt' extension")

# Parse the filename for the applicable information
parts = os.path.basename(filename).split('_')
Expand All @@ -70,9 +70,9 @@ def main():
subsys = parts[-3]

try:
int(seqid)
seqid = int(seqid)
except ValueError:
raise Exception('Invalid filename "%s": . %s' % (os.path.basename(filename), __doc__))
raise Exception('Invalid filename "{os.path.basename(filename)}": . {__doc__}')

sequence = seq.createSeq(filename, id=seqid)

Expand All @@ -83,7 +83,7 @@ def main():
binpath = sequence.binpath
seqid = sequence.seqid

log.info("Writing %s (seqid=0x%04x).", binpath, seqid)
log.info(f"Writing {binpath} (seqid=0x{seqid:04X}).")
sequence.writeBinary()

exit = 0
Expand Down

0 comments on commit b8d3261

Please sign in to comment.