aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xls47.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/ls47.py b/ls47.py
index 335bcce..0c1ec64 100755
--- a/ls47.py
+++ b/ls47.py
@@ -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)