Commits

Andriy Kornatskyy committed 9ee47d7

Fixed compatibility issue with python 2.4 (module uuid)

Comments (0)

Files changed (3)

demos/public/src/app.py

 from wheezy.core.collections import defaultattrdict
 from wheezy.http.request import HttpRequest
 
+from config import dispatch
 from config import options
-from config import handle_errors
 from config import router
 from urls import all_urls
 
     handler, route_args = router.match(environ['PATH_INFO'].lstrip('/'))
     environ['route_args'] = defaultattrdict(str, route_args)
     request = HttpRequest(environ, options=options)
-    response = handle_errors(request, handler)
+    response = dispatch(request, handler)
     return response(start_response)
 
 

demos/public/src/config.py

 })
 
 
-def handle_errors(request, handler):
+def dispatch(request, handler):
     if handler:
         try:
             response = handler(request)
 
 README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
+install_requires = [
+    'wheezy.core',
+    'wheezy.caching',
+    'wheezy.html',
+    'wheezy.http',
+    'wheezy.routing',
+    'wheezy.security',
+    'wheezy.validation',
+    'mako'
+]
+
+try:
+    import uuid
+except:
+    install_requires.append('uuid')
+
 setup(
     name='wheezy.web',
     version='0.1',
     namespace_packages=['wheezy'],
 
     zip_safe=True,
-    install_requires=[
-        'wheezy.core',
-        'wheezy.caching',
-        'wheezy.html',
-        'wheezy.http',
-        'wheezy.routing',
-        'wheezy.security',
-        'wheezy.validation',
-        'mako'
-    ],
+    install_requires = install_requires,
     extras_require={
         'dev': [
             'coverage',