Skip to content

Commit

Permalink
COM-4884-Improve md5 checksum parser when not writing raw image file …
Browse files Browse the repository at this point in the history
…to disk (#160)

* Improve md5 checksum parser when not writing raw image file to disk

* change code

* add
# pylint: disable=no-else-continue

* add
# pylint: disable=no-else-continue to block

* add
# pylint: disable=no-else-continue different blocks
  • Loading branch information
rsanchez87 authored Dec 11, 2023
1 parent acfeb14 commit d9106f5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions fluster/decoders/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,23 @@ def parse_videocodectestsink_md5sum(self, data: List[str], verbose: bool) -> str
"conformance/checksum, checksum-type=(string)MD5, checksum=(string)"
)
sum_start = line.find(pattern)
if sum_start > 0:
# pylint: disable=no-else-continue
if sum_start <= 0:
# Skip to the next iteration if sum_start is less than or equal to 0
continue
else:
sum_start += len(pattern)
sum_end = line[sum_start:].find(";")
if sum_end > 0:
# pylint: disable=no-else-continue
if sum_end <= 0:
# Skip to the next iteration if sum_end is less than or equal to 0
continue
else:
sum_end += sum_start
md5sum = line[sum_start:sum_end]
if not verbose:
return md5sum

if not md5sum:
raise Exception("No MD5 found in the program trace.")

Expand Down

0 comments on commit d9106f5

Please sign in to comment.