From 196515a866d6582fbb4666cc1b78625d31c4f53c Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Thu, 8 Aug 2013 08:40:47 +0200 Subject: Refactor into latest design decision C is an implementation detail of the wrapper API, so we go with 'bindings'. Also create/fix some namespaces. --- cryptography/bindings/__init__.py | 0 cryptography/bindings/openssl/__init__.py | 17 +++++++++++++++++ cryptography/bindings/openssl/api.py | 23 +++++++++++++++++++++++ cryptography/c/__init__.py | 17 ----------------- cryptography/c/api.py | 21 --------------------- tests/bindings/__init__.py | 0 tests/bindings/test_openssl.py | 19 +++++++++++++++++++ tests/test_c.py | 6 ------ 8 files changed, 59 insertions(+), 44 deletions(-) create mode 100644 cryptography/bindings/__init__.py create mode 100644 cryptography/bindings/openssl/__init__.py create mode 100644 cryptography/bindings/openssl/api.py delete mode 100644 cryptography/c/__init__.py delete mode 100644 cryptography/c/api.py create mode 100644 tests/bindings/__init__.py create mode 100644 tests/bindings/test_openssl.py delete mode 100644 tests/test_c.py diff --git a/cryptography/bindings/__init__.py b/cryptography/bindings/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cryptography/bindings/openssl/__init__.py b/cryptography/bindings/openssl/__init__.py new file mode 100644 index 00000000..6c803fbc --- /dev/null +++ b/cryptography/bindings/openssl/__init__.py @@ -0,0 +1,17 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from cryptography.bindings.openssl import api + + +__all__ = ["api"] diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py new file mode 100644 index 00000000..3cc6a0e9 --- /dev/null +++ b/cryptography/bindings/openssl/api.py @@ -0,0 +1,23 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import absolute_import, division, print_function + + +class API(object): + """ + OpenSSL API wrapper. + """ + + +api = API() diff --git a/cryptography/c/__init__.py b/cryptography/c/__init__.py deleted file mode 100644 index 09bf4977..00000000 --- a/cryptography/c/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from cryptography.c.api import api - - -__all__ = ["api"] diff --git a/cryptography/c/api.py b/cryptography/c/api.py deleted file mode 100644 index ea8827f1..00000000 --- a/cryptography/c/api.py +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import absolute_import, division, print_function - - -class API(object): - """OpenSSL API wrapper.""" - - -api = API() diff --git a/tests/bindings/__init__.py b/tests/bindings/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/bindings/test_openssl.py b/tests/bindings/test_openssl.py new file mode 100644 index 00000000..9d637222 --- /dev/null +++ b/tests/bindings/test_openssl.py @@ -0,0 +1,19 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from cryptography.bindings.openssl import api + + +class TestOpenSSL(object): + def test_api_exists(self): + assert api diff --git a/tests/test_c.py b/tests/test_c.py deleted file mode 100644 index c50968e2..00000000 --- a/tests/test_c.py +++ /dev/null @@ -1,6 +0,0 @@ -from cryptography.c import api - - -class TestC(object): - def test_api_exists(self): - assert api -- cgit v1.2.3