1. Ralph Bean
  2. tg-dev

Commits

percious  committed eae096d

fixed tg dependencies.

  • Participants
  • Parent commits 5508bd9
  • Branches default

Comments (0)

Files changed (6)

File setup.py

View file
  • Ignore whitespace
                     'repoze.who-testutil >= 1.0rc3',
                     'wsgiref',
                     'tw.forms',
-                     'Kajiki>=0.2.2',
+                    'Kajiki>=0.2.2',
+                    'repoze.what-pylons >= 1.0rc3',
+                    'repoze.tm2 >= 1.0a4',
+                    'Genshi >= 0.5.1',
                     ]
 
 setup(
     zip_safe=False,
     install_requires=[
         'Pylons >= 0.9.7',
-        'Genshi >= 0.5.1',
         'WebFlash >= 0.1a8',
-        'ToscaWidgets >= 0.9.4',
         'WebError >= 0.10.1',
-        'repoze.what-pylons >= 1.0rc3',
-        'repoze.tm2 >= 1.0a4',
+        'Babel',
     ],
     extras_require={
         #XXX: Perhaps this 'core-testing' extras_require can be removed

File tg/controllers/decoratedcontroller.py

View file
  • Ignore whitespace
 from pylons import request
 from pylons.controllers.util import abort
 
-from repoze.what.predicates import NotAuthorizedError as WhatNotAuthorizedError, not_anonymous
+try:
+    from repoze.what.predicates import NotAuthorizedError as WhatNotAuthorizedError, not_anonymous
+except ImportError:
+    class WhatNotAuthorizedError(Exception):pass
+    def not_anonymous():pass
 
 # demand load tw (ToscaWidets) if needed
 tw = None
         if engine_name in ('genshi','mako') and config['use_toscawidgets']:
             global tw
             if not tw:
-                import tw
+                try:
+                    import tw
+                except ImportError:
+                    pass
 
             tw.framework.default_view = engine_name
 

File tg/decorators.py

View file
  • Ignore whitespace
 from formencode import variabledecode
 from tg import tmpl_context
 from tg.util import partial
-from repoze.what.plugins.pylonshq import ActionProtector
-from repoze.what.plugins.pylonshq.protectors import _BaseProtectionDecorator
+
+try:
+    from repoze.what.plugins.pylonshq import ActionProtector
+    from repoze.what.plugins.pylonshq.protectors import _BaseProtectionDecorator
+except ImportError:
+    class ActionProtector(object):
+        pass
+    class _BaseProtectionDecorator(object):
+        pass
 
 from tg.configuration import Bunch
 from tg.flash import flash

File tg/jsonify.py

View file
  • Ignore whitespace
 
 from simplejson import JSONEncoder
 
-import sqlalchemy
+try:
+    import sqlalchemy
+    from sqlalchemy.engine.base import ResultProxy, RowProxy
+except ImportError:
+    ResultProxy=None
+    RowProxy=None
 
 def is_saobject(obj):
     return hasattr(obj, '_sa_class_manager')
 
-from sqlalchemy.engine.base import ResultProxy, RowProxy
 from webob.multidict import MultiDict
 
 class JsonEncodeError(Exception):pass

File tg/release.py

View file
  • Ignore whitespace
 """TurboGears project related information"""
-version = "2.1rc1"
+version = "2.1"
 description = "Next generation TurboGears built on Pylons"
 long_description="""
 TurboGears brings together a best of breed python tools

File tg/render.py

View file
  • Ignore whitespace
 from paste.deploy.converters import asbool
 from pylons import (app_globals, session, tmpl_context, request,
                     response, templating)
-from repoze.what import predicates
+
+try:
+    from repoze.what import predicates
+except ImportError:
+    predicates = []
+    
 from webhelpers.html import literal
 
 import tg