diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 15:47:11 +0200 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 17:05:58 +0200 |
commit | 6760eb76e665dc81863a82110164c4b3b38e7ee9 (patch) | |
tree | 3a9cf1606c851ad4067c2419fec78e7f6ca044ac /rsa/cli.py | |
parent | ded036cf988b0cf4b20002d88434282f30762638 (diff) | |
download | rsa-git-6760eb76e665dc81863a82110164c4b3b38e7ee9.tar.gz |
Added mypy for static type checking
Diffstat (limited to 'rsa/cli.py')
-rw-r--r-- | rsa/cli.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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__ |