diff options
author | Tom Cocagne <devnull@localhost> | 2011-04-01 11:28:13 -0400 |
---|---|---|
committer | Tom Cocagne <devnull@localhost> | 2011-04-01 11:28:13 -0400 |
commit | 402cdc063b662982d748d72319fa4d8895801d02 (patch) | |
tree | 0e40aa4a9a25afd1ee683109eafa980bd6065263 | |
parent | df477f67f50cfbbd6ed189ea983a2c991e4cb143 (diff) |
ready for 1.0
-rw-r--r-- | MANIFEST.in | 3 | ||||
-rw-r--r-- | README.txt | 2 | ||||
-rwxr-xr-x | setup.py | 20 | ||||
-rw-r--r-- | srp/__init__.py (renamed from srp.py) | 12 | ||||
-rw-r--r-- | srp/_ctsrp.py (renamed from _ctsrp.py) | 0 | ||||
-rw-r--r-- | srp/_pysrp.py (renamed from _pysrp.py) | 0 | ||||
-rw-r--r-- | srp/_srp.c (renamed from _srp.c) | 6 | ||||
-rw-r--r-- | srp/doc/conf.py (renamed from doc/conf.py) | 0 | ||||
-rw-r--r-- | srp/doc/index.rst (renamed from doc/index.rst) | 0 | ||||
-rw-r--r-- | srp/doc/srp.rst (renamed from doc/srp.rst) | 0 | ||||
-rw-r--r-- | srp/test_srp.py (renamed from test_srp.py) | 40 |
11 files changed, 43 insertions, 40 deletions
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..9f39218 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include *.txt +recursive-include srp *.py +recursive-include srp *.rst
\ No newline at end of file @@ -25,7 +25,7 @@ Validity & Performance Testing: python test_srp.py Documentation: - cd doc + cd srp/doc sphinx-build -b html . <desired output directory> @@ -35,19 +35,21 @@ please refer to the `srp module documentation`_. ''' -py_modules = ['_pysrp', '_ctsrp', 'srp'] - -ext_modules = [ Extension('_srp', ['_srp.c',], libraries = ['ssl',]), ] +ext_modules = [ Extension('srp._srp', ['srp/_srp.c',], libraries = ['ssl',]), ] setup(name = 'srp', - version = '1.0', - description = 'Secure Remote Password', - author = 'Tom Cocagne', - author_email = 'tom.cocagne@gmail.com', + version = '1.0', + description = 'Secure Remote Password', + author = 'Tom Cocagne', + author_email = 'tom.cocagne@gmail.com', url = 'http://code.google.com/p/pysrp/', + download_url = 'http://pypi.python.org/pypi/pysrp', long_description = long_description, - py_modules = py_modules, - ext_modules = ext_modules, + packages = ['srp'], + package_data = {'srp' : ['doc/*.rst', 'doc/*.py']}, + ext_modules = ext_modules, + license = "New BSD", + platforms = "OS Independent", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -2,21 +2,21 @@ _mod = None
try:
- import _srp
- _mod = _srp
+ import srp._srp
+ _mod = srp._srp
except ImportError:
pass
if not _mod:
try:
- import _ctsrp
- _mod = _ctsrp
+ import srp._ctsrp
+ _mod = srp._ctsrp
except ImportError:
pass
if not _mod:
- import _pysrp
- _mod = _pysrp
+ import srp._pysrp
+ _mod = srp._pysrp
User = _mod.User
Verifier = _mod.Verifier
diff --git a/_ctsrp.py b/srp/_ctsrp.py index 6754e83..6754e83 100644 --- a/_ctsrp.py +++ b/srp/_ctsrp.py diff --git a/_pysrp.py b/srp/_pysrp.py index ff907ea..ff907ea 100644 --- a/_pysrp.py +++ b/srp/_pysrp.py @@ -1402,7 +1402,7 @@ static PyMethodDef srp_module_methods[] = { static PyTypeObject PyVerifier_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_srp.Verifier", /*tp_name*/ + "srp._srp.Verifier", /*tp_name*/ sizeof(PyVerifier), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ @@ -1447,7 +1447,7 @@ static PyTypeObject PyVerifier_Type = { static PyTypeObject PyUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_srp.User", /*tp_name*/ + "srp._srp.User", /*tp_name*/ sizeof(PyUser), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ @@ -1539,7 +1539,7 @@ init_srp(void) if (PyType_Ready(&PyVerifier_Type) < 0 || PyType_Ready(&PyUser_Type) < 0) return; - m = Py_InitModule3("_srp", srp_module_methods,"SRP-6a implementation"); + m = Py_InitModule3("srp._srp", srp_module_methods,"SRP-6a implementation"); if (m == NULL) return; diff --git a/doc/conf.py b/srp/doc/conf.py index ba75a8c..ba75a8c 100644 --- a/doc/conf.py +++ b/srp/doc/conf.py diff --git a/doc/index.rst b/srp/doc/index.rst index 0c13606..0c13606 100644 --- a/doc/index.rst +++ b/srp/doc/index.rst diff --git a/doc/srp.rst b/srp/doc/srp.rst index 9cdd967..9cdd967 100644 --- a/doc/srp.rst +++ b/srp/doc/srp.rst diff --git a/test_srp.py b/srp/test_srp.py index d7f3538..37cf4c3 100644 --- a/test_srp.py +++ b/srp/test_srp.py @@ -7,36 +7,34 @@ import sys import time import thread - -try: - import _srp -except ImportError: - this_dir = os.path.dirname( os.path.abspath(__file__) ) +this_dir = os.path.dirname( os.path.abspath(__file__) ) - build_dir = os.path.join( this_dir, 'build' ) +build_dir = os.path.join( os.path.dirname(this_dir), 'build' ) - if not os.path.exists( build_dir ): - print 'Please run "python setup.py build" prior to running tests' - sys.exit(1) +if not os.path.exists( build_dir ): + print 'Please run "python setup.py build" prior to running tests' + sys.exit(1) - plat_dirs = [ d for d in os.listdir('build') if d.startswith('lib') ] +plat_dirs = [ d for d in os.listdir('build') if d.startswith('lib') ] + +if not len(plat_dirs) == 1: + print 'Unexpected build result... aborting' + +plat_dir = os.path.join( build_dir, plat_dirs[0] ) - if not len(plat_dirs) == 1: - print 'Unexpected build result... aborting' +sys.path.insert(0, os.path.join('build', plat_dir) ) - plat_dir = os.path.join( build_dir, plat_dirs[0] ) - sys.path.append( os.path.join('build', plat_dir) ) import srp -import _pysrp -import _ctsrp +import srp._pysrp as _pysrp +import srp._ctsrp as _ctsrp try: - import _srp + import srp._srp as _srp except ImportError: - print 'Failed to import _srp. Aborting tests' + print 'Failed to import srp._srp. Aborting tests' sys.exit(1) @@ -183,9 +181,9 @@ def performance_test( mod, hash_alg, ng_type, niter=10, nthreads=1 ): def get_param_str( mod, hash_alg, ng_type ): - m = { '_pysrp' : 'Python', - '_ctsrp' : 'ctypes', - '_srp' : 'C ' } + m = { 'srp._pysrp' : 'Python', + 'srp._ctsrp' : 'ctypes', + 'srp._srp' : 'C ' } cfg = '%s, %s, %d:' % (m[mod.__name__], hash_map[hash_alg], prime_map[ng_type]) |