From e1b2d3cb863e5d157da1c1766dc3f86ac3bb29e9 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 13 Sep 2013 21:26:21 -0500 Subject: remove import function, rename attrs to upper in modules --- cryptography/bindings/openssl/api.py | 13 +++---------- cryptography/bindings/openssl/evp.py | 6 +++--- cryptography/bindings/openssl/opensslv.py | 6 +++--- 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 """ -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 """ -types = """ +TYPES = """ static char *const OPENSSL_VERSION_TEXT; """ -functions = "" +FUNCTIONS = "" -- cgit v1.2.3