Skip to content

Commit

Permalink
[NXP] Add to flake8 in workflow and fix python files (part #25193) (#…
Browse files Browse the repository at this point in the history
…25305)

* [NXP] Add to flake8 in workflow and fix python files

* Restyled by isort

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Jul 11, 2023
1 parent c2f8c16 commit 3529561
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ exclude = third_party
examples/common/pigweed/rpc_console/py/chip_rpc/console.py
examples/lighting-app/python/lighting.py
examples/platform/mbed/ota/generate_ota_list_image.py
examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py
scripts/build/build/target.py
scripts/build/build/targets.py
scripts/build/builders/android.py
Expand Down Expand Up @@ -81,9 +80,6 @@ exclude = third_party
scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py
scripts/tools/nrfconnect/nrfconnect_generate_partition.py
scripts/tools/nrfconnect/tests/test_generate_factory_data.py
scripts/tools/nxp/factory_data_generator/custom.py
scripts/tools/nxp/factory_data_generator/default.py
scripts/tools/nxp/factory_data_generator/generate.py
scripts/tools/silabs/FactoryDataProvider.py
scripts/tools/telink/mfg_tool.py
scripts/tools/zap/generate.py
Expand Down
6 changes: 3 additions & 3 deletions examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def decode_string(tstr, detok):
if s.find('$') == 0:
return None
return s
except:
except ValueError:
return None


Expand Down Expand Up @@ -88,7 +88,7 @@ def decode_serial(serialport, outfile, database):
print(line, file=sys.stdout)
if output:
print(line, file=output)
except:
except Exception:
print("Serial error or program closed", file=sys.stderr)

if output:
Expand Down Expand Up @@ -120,7 +120,7 @@ def decode_file(infile, outfile, database):
# ascii decode line
# serial terminals may include non ascii characters
line = line.decode('ascii').strip()
except:
except Exception:
continue
# find token start and detokenize
idx = line.rfind(']')
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/nxp/factory_data_generator/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def custom_function(self):

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_der_private_key
from default import *
from default import Base64Argument, FileArgument, IntArgument, StrArgument


class Verifier(Base64Argument):
Expand Down
1 change: 0 additions & 1 deletion scripts/tools/nxp/factory_data_generator/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import base64
import logging
import sys


class InputArgument:
Expand Down
5 changes: 3 additions & 2 deletions scripts/tools/nxp/factory_data_generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import argparse
import hashlib
import logging
import os
import subprocess
import sys

from custom import *
from custom import (CertDeclaration, DacCert, DacPKey, Discriminator, HardwareVersion, HardwareVersionStr, IterationCount,
ManufacturingDate, PaiCert, PartNumber, ProductId, ProductLabel, ProductName, ProductURL, Salt, SerialNum,
SetupPasscode, StrArgument, UniqueId, VendorId, VendorName, Verifier)
from default import InputArgument


Expand Down

0 comments on commit 3529561

Please sign in to comment.