Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 30873ef

Browse files
committed
Code cleanup
1 parent 7504c2a commit 30873ef

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

setup.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555

5656
install_package = True
5757
try:
58-
# If the version that is being installed is older than the one currently installed, suggest to use a virtual environment.
58+
# If the version that is being installed is older than the one currently installed, suggest
59+
# to use a virtual environment.
5960

6061
import pkg_resources
6162
installed_packages = [d for d in pkg_resources.working_set]
@@ -73,17 +74,18 @@
7374

7475
if legacy_version:
7576
valid_response = ["y", "yes"]
76-
msg = "A newer version of nrfutil may already be installed. Consider using a separate virtual environment when installing legacy versions. \nProceed (y/N)? "
77+
msg = ("A newer version of nrfutil may already be installed. Consider using a separate "
78+
"virtual environment when installing legacy versions. \nProceed (y/N)? ")
7779
print(msg)
7880
sys.stdout.flush()
7981
prompt = sys.stdin.readline().strip()
8082
if(prompt.lower() not in valid_response):
8183
install_package = False
8284

8385
except ImportError:
84-
pass # pkg_resources not available.
85-
except:
86-
pass # Nrfutil is not already installed.
86+
pass # pkg_resources not available.
87+
except Exception:
88+
pass # Nrfutil is not already installed.
8789

8890

8991
# Exit program if user doesn't want to replace newer version.
@@ -120,6 +122,7 @@
120122
with open("requirements.txt") as reqs_file:
121123
reqs = reqs_file.readlines()
122124

125+
123126
class NoseTestCommand(TestCommand):
124127
def finalize_options(self):
125128
TestCommand.finalize_options(self)
@@ -130,16 +133,17 @@ def run_tests(self):
130133
import nose
131134
nose.run_exit(argv=['nosetests', '--with-xunit', '--xunit-file=test-reports/unittests.xml'])
132135

136+
133137
setup(
134138
name="nrfutil",
135139
version=version.NRFUTIL_VERSION,
136140
license="Modified BSD License",
137-
author = "Nordic Semiconductor ASA",
141+
author="Nordic Semiconductor ASA",
138142
url="https://github.com/NordicSemiconductor/pc-nrfutil",
139143
description="Nordic Semiconductor nrfutil utility and Python library",
140144
long_description=description,
141145
packages=find_packages(exclude=["tests.*", "tests"]),
142-
package_data = {
146+
package_data={
143147
'': ['../requirements.txt', 'thread/hex/ncp.hex', 'zigbee/hex/ota.hex',
144148
'../libusb/x86/libusb-1.0.dll', '../libusb/x64/libusb-1.0.dll',
145149
'../libusb/x64/libusb-1.0.dylib', '../libusb/LICENSE']
@@ -169,7 +173,7 @@ def run_tests(self):
169173

170174
'Programming Language :: Python :: 3.7',
171175
],
172-
keywords = 'nordic nrf51 nrf52 ble bluetooth dfu ota softdevice serialization nrfutil pc-nrfutil',
176+
keywords='nordic nrf51 nrf52 ble bluetooth dfu ota softdevice serialization nrfutil pc-nrfutil',
173177
cmdclass={
174178
'test': NoseTestCommand
175179
},

0 commit comments

Comments
 (0)