Skip to content

Commit

Permalink
Merge pull request #12 from makermelissa/main
Browse files Browse the repository at this point in the history
Updated so checks are passing
  • Loading branch information
makermelissa authored Jun 14, 2021
2 parents e4d4d65 + 5c71565 commit 264f418
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

repos:
- repo: https://github.com/python/black
rev: 19.10b0
rev: 21.6b0
hooks:
- id: black
- repo: https://github.com/fsfe/reuse-tool
rev: latest
rev: v0.12.1
hooks:
- id: reuse
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand Down
13 changes: 9 additions & 4 deletions adafruit_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def select_n(message, selections):

for index, selection in enumerate(selections):
options.append(
{"selector": str(index + 1), "prompt": selection, "return": index + 1,}
{
"selector": str(index + 1),
"prompt": selection,
"return": index + 1,
}
)
return prompt.options(message, options)

Expand All @@ -66,9 +70,11 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
original_stdout = sys.stdout
original_stderr = sys.stderr
try:
# pylint: disable=consider-using-with
proc = subprocess.Popen(
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# pylint: enable=consider-using-with
full_output = ""
while True:
output = proc.stdout.readline()
Expand Down Expand Up @@ -391,9 +397,8 @@ def write_text_file(self, path, content, append=True):
content = "\n" + content
else:
mode = "w"
service_file = open(self.path(path), mode)
service_file.write(content)
service_file.close()
with open(self.path(path), mode) as service_file:
service_file.write(content)

@staticmethod
def is_python3():
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
# Author details
author="Adafruit Industries",
author_email="[email protected]",
install_requires=["clint", "Adafruit-PlatformDetect",],
install_requires=[
"clint",
"Adafruit-PlatformDetect",
],
# Choose your license
license="MIT",
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 264f418

Please sign in to comment.