Commits

percious  committed 2206b13

added support for local: in the dotted template lookup (for plugins)
added support for jsonification to disploy MultiDicts
removed logging statements for i18n

  • Participants
  • Parent commits a058dd7

Comments (0)

Files changed (3)

File tg/dottednamesupport.py

         the value we are given without any change.
 
         """
+        if uri.startswith('local:'):
+            uri = uri.replace('local:', tg.config['pylons.package']+'.')
         if '.' in uri:
             # We are in the DottedTemplateLookup system so dots in
             # names should be treated as a Python path. Since this
         """
         if template.filename is None:
             return template
+        
 
         if not os.path.exists(template.filename):
             # remove from cache.
     languages should be a string or a list of strings.
     First lang will be used as main lang, others as fallbacks.
     """
+    # the logging to the screen was removed because
+    # the printing to the screen for every problem causes serious slow down.
+    
     try:
         pylons.i18n.set_lang(languages)
     except LanguageError:
-        log.warn("Language %s: not supported", languages)
+        pass
+        #log.warn("Language %s: not supported", languages)
     try:
         set_formencode_translation(languages)
     except LanguageError:
-        log.warn("Language %s: not supported by FormEncode", languages)
+        pass
+        #log.warn("Language %s: not supported by FormEncode", languages)
 
 
 def set_lang(languages, **kwargs):

File tg/jsonify.py

     return hasattr(obj, '_sa_class_manager')
 
 from sqlalchemy.engine.base import ResultProxy, RowProxy
-
+from webob import MultiDict
 
 # JSON Encoder class
 
             return props
         elif isinstance(obj, ResultProxy):
             return list(obj)
+        elif isinstance(obj, MultiDict):
+            return obj.mixed()
         elif isinstance(obj, RowProxy):
             return dict(obj)
         else: