Commits

Andriy Kornatskyy committed bd61c69

Fixed compatibility with python3.2

  • Participants
  • Parent commits 2f0d59a

Comments (0)

Files changed (7)

+Copyright (C) 2011 by Andriy Kornatskyy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
-include Makefile
-recursive-include demos *.py
+include LICENSE README
 PYTHON=env/bin/python$(VERSION)
 EASY_INSTALL=env/bin/easy_install-$(VERSION)
 PYTEST=env/bin/py.test-$(VERSION)
-NOSE=env/bin/nosetest-$(VERSION)
+NOSE=env/bin/nosetests-$(VERSION)
 
 all: clean test release
 
 		src/wheezy/routing
 
 doctest-cover:
-	$(NOSE) --where=src/wheezy/routing --match=^test \
-		--with-doctest --detailed-errors --with-coverage \
-		--cover-package=wheezy.routing
+	$(NOSE) --with-doctest --detailed-errors --with-coverage \
+		--cover-package=wheezy.routing src/wheezy/routing/*.py
 
 test-cover:
 	$(PYTEST) -q --cov wheezy.routing \
 #!/usr/bin/env python
 
+import os
+
 try:
     from setuptools import setup
 except:
     from distutils.core import setup
 
-def read(fname):
-    from os.path import dirname, join
-    return open(join(dirname(__file__), fname)).read()
+README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
 setup(
     name = 'wheezy-routing',
     version = '0.1',
     description = 'A lightweight path routing library',
-    long_description = read('README'),
+    long_description = README,
     url = 'https://bitbucket.org/akorn/wheezy-routing',
 
     author = 'Andriy Kornatskyy',
         'Natural Language :: English',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
         'Programming Language :: Python :: 2.4',
         'Programming Language :: Python :: 2.5',
         'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.0',
+        'Programming Language :: Python :: 3.1',
+        'Programming Language :: Python :: 3.2',
         'Topic :: Internet :: WWW/HTTP',
         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
         'Topic :: Internet :: WWW/HTTP :: WSGI',
         'Topic :: Software Development :: Libraries :: Python Modules',
         'Topic :: Utilities'
     ],
+    keywords = ['routing', 'path', 'url', 'match', 'web', 'mapping'],
     packages = ['wheezy', 'wheezy.routing'],
     package_dir = {'': 'src'},
 

src/wheezy/routing/tests/test_config.py

 
 import unittest
 
-from wheezy.routing.p2t3 import iscallable
+from wheezy.routing.p2to3 import iscallable
 
 
 class RouteBuildersTestCase(unittest.TestCase):

src/wheezy/routing/tests/test_route.py

 
 import unittest
 
-from wheezy.routing.p2t3 import iscallable
+from wheezy.routing.p2to3 import iscallable
 
 
 class RouteTestCase(unittest.TestCase):

src/wheezy/routing/utils.py

         >>> class Login: pass
         >>> route_name(Login)
         'login'
+        >>> l = Login()
+        >>> route_name(l)
+        'login'
     """
 
     try: