From fca214ad12ce640a51a49a62d8cb68bb10f32b47 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sun, 30 Nov 2014 03:07:52 +0100 Subject: [PATCH] More unifying after merge with master --- letsencrypt/client/client.py | 33 ++++++++++--------------------- letsencrypt/client/crypto_util.py | 2 -- letsencrypt/client/le_util.py | 7 ++----- letsencrypt/scripts/main.py | 10 ++++------ 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 403360f57..5284eb5eb 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -36,20 +36,11 @@ class Client(object): private_key=None, private_key_file=None, use_curses=True): """ - :param ca_server: Certificate authority server - :type ca_server: str - - :param cert_signing_request: Contents of the CSR - :type cert_signing_request: str - - :param private_key: Contents of the private key - :type private_key: str - - :param private_key_file: absolute path to private_key - :type private_key_file: str - - :param use_curses: Use curses UI - :type use_curses: bool + :param str ca_server: Certificate authority server + :param str cert_signing_request: Contents of the CSR + :param str private_key: Contents of the private key + :param str private_key_file: absolute path to private_key + :param bool use_curses: Use curses UI """ self.curses = use_curses @@ -80,14 +71,12 @@ class Client(object): def authenticate(self, domains=None, redirect=None, eula=False): """ - :param domains: List of domains - :type domains: list + :param list domains: List of domains :param redirect: - :type redirect: bool|None + :type redirect: bool or None - :param eula: EULA accepted - :type eula: bool + :param bool eula: EULA accepted :raises errors.LetsEncryptClientError: CSR does not contain one of the specified names. @@ -757,8 +746,7 @@ def remove_cert_key(cert): def sanity_check_names(names): """Make sure host names are valid. - :param names: List of host names - :type names: list + :param list names: List of host names """ for name in names: @@ -773,8 +761,7 @@ def is_hostname_sane(hostname): Do enough to avoid shellcode from the environment. There's no need to do more. - :param hostname: Host name to validate - :type hostname: str + :param str hostname: Host name to validate :returns: True if hostname is valid, otherwise false. :rtype: bool diff --git a/letsencrypt/client/crypto_util.py b/letsencrypt/client/crypto_util.py index c945b4414..a53edc85a 100644 --- a/letsencrypt/client/crypto_util.py +++ b/letsencrypt/client/crypto_util.py @@ -32,7 +32,6 @@ def create_sig(msg, key_str, nonce=None, nonce_len=CONFIG.NONCE_SIZE): :param str key_str: Key in string form. Accepted formats are the same as for `Crypto.PublicKey.RSA.importKey`. - :type key_str: str :param str msg: Message to be signed @@ -231,7 +230,6 @@ def csr_matches_names(csr, domains): also check the SAN extension. This is insufficient for full testing :param str csr: CSR file contents - :type csr: str :param list domains: Domains the CSR should contain. diff --git a/letsencrypt/client/le_util.py b/letsencrypt/client/le_util.py index a5b289446..75924e08b 100644 --- a/letsencrypt/client/le_util.py +++ b/letsencrypt/client/le_util.py @@ -48,11 +48,8 @@ def check_permissions(filepath, mode, uid=0): def unique_file(default_name, mode=0o777): """Safely finds a unique file for writing only (by default). - :param default_name: Default file name - :type default_name: str - - :param mode: File mode - :type mode: int + :param str default_name: Default file name + :param int mode: File mode :return: tuple of file object and file name diff --git a/letsencrypt/scripts/main.py b/letsencrypt/scripts/main.py index d38762925..fdd5746b1 100755 --- a/letsencrypt/scripts/main.py +++ b/letsencrypt/scripts/main.py @@ -100,8 +100,7 @@ def main(): def read_file(filename): """Returns the given file's contents with universal new line support. - :param filename: Filename - :type filename: str + :param str filename: Filename :returns: File contents :rtype: str @@ -119,10 +118,9 @@ def rollback(config, checkpoints): """Revert configuration the specified number of checkpoints. :param config: Configurator object - :type config: ApacheConfigurator + :type config: :class:`ApacheConfigurator` - :param checkpoints: Number of checkpoints to revert. - :type checkpoints: int + :param int checkpoints: Number of checkpoints to revert. """ config.rollback_checkpoints(checkpoints) @@ -133,7 +131,7 @@ def view_checkpoints(config): """View checkpoints and associated configuration changes. :param config: Configurator object - :type config: ApacheConfigurator + :type config: :class:`ApacheConfigurator` """ config.display_checkpoints()