Skip to content

Commit

Permalink
Align to pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Aug 26, 2020
1 parent 478246d commit e10fe94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ipwb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def checkArgs_index(args):


def checkArgs_replay(args):
supplied_index_parameter = hasattr(args, 'index') and args.index is not None
supplied_index_parameter = hasattr(args, 'index') and \
args.index is not None
likely_piping = not sys.stdin.isatty()

if not supplied_index_parameter and likely_piping:
Expand Down
13 changes: 7 additions & 6 deletions ipwb/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def formatters():

@app.after_request
def set_server_header(response):
response.headers['Server'] = f'InterPlanetary Wayback Replay/{ipwb_version}'
response.headers['Server'] = ('InterPlanetary Wayback Replay/'
f'{ipwb_version}')
response.autocorrect_location_header = False
return response

Expand Down Expand Up @@ -690,7 +691,7 @@ def handler(signum, frame):
key_string = jObj['encryption_key']
else:
ask_for_key = ('Enter a path for file',
' containing decryption key: \n> ')
' containing decryption key: \n> ')
key_string = raw_input(ask_for_key)

padded_encryption_key = pad(key_string, AES.block_size)
Expand All @@ -702,10 +703,10 @@ def handler(signum, frame):
payload = cipher.decrypt(base64.b64decode(payload))

h_lines = header.decode() \
.replace('\r', '') \
.replace('\n\t', '\t') \
.replace('\n ', ' ') \
.split('\n')
.replace('\r', '') \
.replace('\n\t', '\t') \
.replace('\n ', ' ') \
.split('\n')
h_lines.pop(0)

status = 200
Expand Down

0 comments on commit e10fe94

Please sign in to comment.