Skip to content
Snippets Groups Projects
Unverified Commit 1e40d5d3 authored by Jakob Haufe's avatar Jakob Haufe
Browse files

Fix code style

parent d8a5fcbc
No related branches found
No related tags found
No related merge requests found
Pipeline #3845 passed
......@@ -3,21 +3,26 @@ import sys
try:
import crc16
crcfun = crc16.crc16xmodem
except ImportError:
try:
import crcmod
crcfun = crcmod.predefined.mkCrcFun('xmodem')
crcfun = crcmod.predefined.mkCrcFun("xmodem")
except ImportError:
try:
import crcelk
crcfun = crcelk.CRC_XMODEM.calc_bytes
except ImportError:
raise Exception('Could not find a CRC implementation. Tried: crc16, crcmod, crcelk.')
raise Exception(
"Could not find a CRC implementation. Tried: crc16, crcmod, crcelk."
)
def main():
data = open(sys.argv[1], 'rb').read()
data = open(sys.argv[1], "rb").read()
crc = crcfun(data)
# print(crc)
......@@ -26,7 +31,7 @@ def main():
crc = crcfun(padded)
# print(crc)
open(sys.argv[1], 'wb').write(padded)
open(sys.argv[1], "wb").write(padded)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment