Skip to content

Commit ffae300

Browse files
committed
Linted
1 parent e4d4d65 commit ffae300

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

adafruit_shell.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ def select_n(message, selections):
5555

5656
for index, selection in enumerate(selections):
5757
options.append(
58-
{"selector": str(index + 1), "prompt": selection, "return": index + 1,}
58+
{
59+
"selector": str(index + 1),
60+
"prompt": selection,
61+
"return": index + 1,
62+
}
5963
)
6064
return prompt.options(message, options)
6165

@@ -66,9 +70,11 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
6670
original_stdout = sys.stdout
6771
original_stderr = sys.stderr
6872
try:
73+
# pylint: disable=consider-using-with
6974
proc = subprocess.Popen(
7075
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
7176
)
77+
# pylint: enable=consider-using-with
7278
full_output = ""
7379
while True:
7480
output = proc.stdout.readline()
@@ -391,9 +397,8 @@ def write_text_file(self, path, content, append=True):
391397
content = "\n" + content
392398
else:
393399
mode = "w"
394-
service_file = open(self.path(path), mode)
395-
service_file.write(content)
396-
service_file.close()
400+
with open(self.path(path), mode) as service_file:
401+
service_file.write(content)
397402

398403
@staticmethod
399404
def is_python3():

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
# Author details
3535
author="Adafruit Industries",
3636
author_email="[email protected]",
37-
install_requires=["clint", "Adafruit-PlatformDetect",],
37+
install_requires=[
38+
"clint",
39+
"Adafruit-PlatformDetect",
40+
],
3841
# Choose your license
3942
license="MIT",
4043
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)