summaryrefslogtreecommitdiff
path: root/rsa
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2019-08-04 15:47:11 +0200
committerSybren A. Stüvel <sybren@stuvel.eu>2019-08-04 17:05:58 +0200
commit6760eb76e665dc81863a82110164c4b3b38e7ee9 (patch)
tree3a9cf1606c851ad4067c2419fec78e7f6ca044ac /rsa
parentded036cf988b0cf4b20002d88434282f30762638 (diff)
downloadrsa-git-6760eb76e665dc81863a82110164c4b3b38e7ee9.tar.gz
Added mypy for static type checking
Diffstat (limited to 'rsa')
-rw-r--r--rsa/cli.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/rsa/cli.py b/rsa/cli.py
index 77bd4ee..cbf3f97 100644
--- a/rsa/cli.py
+++ b/rsa/cli.py
@@ -21,9 +21,11 @@ These scripts are called by the executables defined in setup.py.
import abc
import sys
+import typing
from optparse import OptionParser
import rsa
+import rsa.key
import rsa.pkcs1
HASH_METHODS = sorted(rsa.pkcs1.HASH_METHODS.keys())
@@ -84,14 +86,12 @@ def keygen():
sys.stdout.buffer.write(data)
-class CryptoOperation(object):
+class CryptoOperation(metaclass=abc.ABCMeta):
"""CLI callable that operates with input, output, and a key."""
- __metaclass__ = abc.ABCMeta
-
keyname = 'public' # or 'private'
usage = 'usage: %%prog [options] %(keyname)s_key'
- description = None
+ description = ''
operation = 'decrypt'
operation_past = 'decrypted'
operation_progressive = 'decrypting'
@@ -102,7 +102,7 @@ class CryptoOperation(object):
expected_cli_args = 1
has_output = True
- key_class = rsa.PublicKey
+ key_class = rsa.PublicKey # type: typing.Type[rsa.key.AbstractKey]
def __init__(self):
self.usage = self.usage % self.__class__.__dict__