diff options
Diffstat (limited to 'ls47.py')
| -rwxr-xr-x | ls47.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -183,14 +183,14 @@ if __name__ == "__main__": "--exact-input", dest="inx", help="Do not convert input spaces to `_', ignore them instead.", - action="store_true" + action="store_true", ) ap.add_argument( "-O", "--exact-output", dest="outx", help="Do not convert output `_'s to spaces.", - action="store_true" + action="store_true", ) args = ap.parse_args() @@ -202,13 +202,15 @@ if __name__ == "__main__": elif args.fullkey: key = args.fullkey else: - raise ValueError("Specify at least one of password and full key (options -s and -K)") + raise ValueError( + "Specify at least one of password and full key (options -s and -K)" + ) input = sys.stdin.read() if not args.inx: - input = input.replace(' ', '_') + input = input.replace(" ", "_") letter_set = set(letters) - input = ''.join(filter(lambda x:x in letter_set, input.upper())) + input = "".join(filter(lambda x: x in letter_set, input.upper())) if args.decrypt: if args.sign is None: @@ -222,6 +224,6 @@ if __name__ == "__main__": output = encrypt_pad(key, input, args.sign) if not args.outx: - output = output.replace('_', ' ') + output = output.replace("_", " ") print(output) |
