From 5b6ce2a63a2408638bb7636639abfb1c771585d5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 24 Feb 2014 20:16:10 -0600 Subject: some style fixes suggested by pep8-naming --- cryptography/hazmat/primitives/asymmetric/rsa.py | 2 +- cryptography/hazmat/primitives/twofactor/hotp.py | 4 ++-- docs/development/submitting-patches.rst | 5 ++++- setup.py | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cryptography/hazmat/primitives/asymmetric/rsa.py b/cryptography/hazmat/primitives/asymmetric/rsa.py index 01218592..23572a53 100644 --- a/cryptography/hazmat/primitives/asymmetric/rsa.py +++ b/cryptography/hazmat/primitives/asymmetric/rsa.py @@ -132,7 +132,7 @@ class RSAPrivateKey(object): self._modulus = modulus @classmethod - def generate(self, public_exponent, key_size, backend): + def generate(cls, public_exponent, key_size, backend): return backend.generate_rsa_private_key(public_exponent, key_size) @property diff --git a/cryptography/hazmat/primitives/twofactor/hotp.py b/cryptography/hazmat/primitives/twofactor/hotp.py index a5c88dae..80e28820 100644 --- a/cryptography/hazmat/primitives/twofactor/hotp.py +++ b/cryptography/hazmat/primitives/twofactor/hotp.py @@ -52,5 +52,5 @@ class HOTP(object): offset_bits = six.indexbytes(hmac_value, 19) & 0b1111 offset = int(offset_bits) - P = hmac_value[offset:offset + 4] - return struct.unpack(">I", P)[0] & 0x7fffffff + p = hmac_value[offset:offset + 4] + return struct.unpack(">I", p)[0] & 0x7fffffff diff --git a/docs/development/submitting-patches.rst b/docs/development/submitting-patches.rst index 5dca3f79..1797b9c1 100644 --- a/docs/development/submitting-patches.rst +++ b/docs/development/submitting-patches.rst @@ -15,7 +15,10 @@ follow the directions on the :doc:`security page `. Code ---- -When in doubt, refer to :pep:`8` for Python code. +When in doubt, refer to :pep:`8` for Python code. You can check if your code +meets our automated requirements by running ``flake8`` against it. If you've +installed the development requirements this will automatically use our +configuration. You can also run the ``tox`` job with ``tox -e pep8``. `Write comments as complete sentences.`_ diff --git a/setup.py b/setup.py index 81a50f44..a2a75504 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ requirements = [ ] -class cffi_build(build): +class CFFIBuild(build): """ This class exists, instead of just providing ``ext_modules=[...]`` directly in ``setup()`` because importing cryptography requires we have several @@ -110,6 +110,6 @@ setup( zip_safe=False, ext_package="cryptography", cmdclass={ - "build": cffi_build, + "build": CFFIBuild, } ) -- cgit v1.2.3