aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-09-13 21:26:21 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-09-13 21:28:04 -0500
commite1b2d3cb863e5d157da1c1766dc3f86ac3bb29e9 (patch)
tree91f6aa160fb8a23c99eec76b1866423bcc337126
parent39a45c5741ea5c62af2fd530d8fb3ebc2055116a (diff)
downloadcryptography-e1b2d3cb863e5d157da1c1766dc3f86ac3bb29e9.tar.gz
cryptography-e1b2d3cb863e5d157da1c1766dc3f86ac3bb29e9.tar.bz2
cryptography-e1b2d3cb863e5d157da1c1766dc3f86ac3bb29e9.zip
remove import function, rename attrs to upper in modules
-rw-r--r--cryptography/bindings/openssl/api.py13
-rw-r--r--cryptography/bindings/openssl/evp.py6
-rw-r--r--cryptography/bindings/openssl/opensslv.py6
3 files changed, 9 insertions, 16 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py
index c5da9fb1..bc2b4ae4 100644
--- a/cryptography/bindings/openssl/api.py
+++ b/cryptography/bindings/openssl/api.py
@@ -44,16 +44,9 @@ class API(object):
for name in self._modules:
__import__('cryptography.bindings.openssl.' + name)
module = sys.modules['cryptography.bindings.openssl.' + name]
- self._import_definitions(module, 'includes')
- self._import_definitions(module, 'types')
- self._import_definitions(module, 'functions')
-
- def _import_definitions(self, module, name):
- """
- Import definitions named definitions from module
- """
- container = getattr(self, name)
- container.append(getattr(module, name))
+ self.includes.append(module.INCLUDES)
+ self.types.append(module.TYPES)
+ self.functions.append(module.FUNCTIONS)
def _define(self):
for typedef in self.types:
diff --git a/cryptography/bindings/openssl/evp.py b/cryptography/bindings/openssl/evp.py
index 0d969cf8..7795e935 100644
--- a/cryptography/bindings/openssl/evp.py
+++ b/cryptography/bindings/openssl/evp.py
@@ -11,17 +11,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-includes = """
+INCLUDES = """
#include <openssl/evp.h>
"""
-types = """
+TYPES = """
typedef struct { ...; } EVP_CIPHER_CTX;
typedef ... EVP_CIPHER;
typedef ... ENGINE;
"""
-functions = """
+FUNCTIONS = """
void OpenSSL_add_all_algorithms();
const EVP_CIPHER *EVP_get_cipherbyname(const char *);
int EVP_EncryptInit_ex(EVP_CIPHER_CTX *, const EVP_CIPHER *,
diff --git a/cryptography/bindings/openssl/opensslv.py b/cryptography/bindings/openssl/opensslv.py
index ace7bded..a8f0b9b8 100644
--- a/cryptography/bindings/openssl/opensslv.py
+++ b/cryptography/bindings/openssl/opensslv.py
@@ -11,13 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-includes = """
+INCLUDES = """
#include <openssl/opensslv.h>
"""
-types = """
+TYPES = """
static char *const OPENSSL_VERSION_TEXT;
"""
-functions = ""
+FUNCTIONS = ""