Skip to content

Commit

Permalink
sendto: Format with yapf
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Jan 10, 2024
1 parent 1614a53 commit fe11021
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sendto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import subprocess
import sys
from os.path import exists

GET_MAINTAINER_PATH = "./scripts/get_maintainer.pl"
if not exists(GET_MAINTAINER_PATH):
raise Exception(f"Can't find {GET_MAINTAINER_PATH}, "
"are you in linux directory?"
)
"are you in linux directory?")

argv = sys.argv
if len(argv) < 2:
Expand All @@ -15,12 +15,12 @@ if argv[1][-6:] != '.patch':
raise Exception("Need .patch file (check arg)")
cmd = [f"{GET_MAINTAINER_PATH}", argv[1]]
try:
result = subprocess.run(cmd, stdout=subprocess.PIPE,
result = subprocess.run(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except:
print(f"subprocess.run failure... "
"Potentially lacking permissions for {GET_MAINTAINER_PATH}"
)
"Potentially lacking permissions for {GET_MAINTAINER_PATH}")

get_maintainer_output = result.stdout.decode('UTF-8')
get_maintainer_errors = result.stderr.decode('UTF-8')
Expand All @@ -31,9 +31,9 @@ lines = []
for line in get_maintainer_output.split('\n')[:-1]:
line = line.strip()
idx_of_paren = line.index('(')
before = line[0:idx_of_paren-1]
before = line[0:idx_of_paren - 1]
before = before.replace('"', '')
after = line[idx_of_paren+1:-1]
after = line[idx_of_paren + 1:-1]
lines.append((before, after))

TO = '--to '
Expand Down

0 comments on commit fe11021

Please sign in to comment.