From 8c44552d2905d6e03f0293d705be199a8ce9f222 Mon Sep 17 00:00:00 2001
From: legac <renaud.legac@free.fr>
Date: Sat, 11 Apr 2015 11:06:37 +0200
Subject: [PATCH] Remove current.T at the begining of a module since it
 prevents import outside web2py.

---
 modules/plugin_dbui/modifier.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/plugin_dbui/modifier.py b/modules/plugin_dbui/modifier.py
index a56f26e6..fe876173 100644
--- a/modules/plugin_dbui/modifier.py
+++ b/modules/plugin_dbui/modifier.py
@@ -8,7 +8,7 @@ from gluon.storage import Storage
 from gluon.tools import PluginManager
 
 
-MSG_INVALID_TYPE = current.T("Invalid plugin type")
+MSG_INVALID_TYPE = "Invalid plugin type"
 
 
 class Modifier(object):
@@ -87,6 +87,8 @@ class Modifier(object):
               when the keyword argument C{xtype} is used.
             
         """
+        T = current.T
+        
         if 'plugins' in extjs:
             
             plugins = extjs['plugins']
@@ -104,7 +106,7 @@ class Modifier(object):
                     elif isinstance(el, dict):
                         ptypes.append(el['ptype'])
                     else:
-                        raise TypeError(MSG_INVALID_TYPE)
+                        raise TypeError(T(MSG_INVALID_TYPE))
                 
                 # append new plugins replacing existing one 
                 for plugin in plugins:
@@ -115,7 +117,7 @@ class Modifier(object):
                     elif isinstance(plugin, dict):
                         ptype= plugin['ptype']
                     else:
-                        raise TypeError(MSG_INVALID_TYPE)
+                        raise TypeError(T(MSG_INVALID_TYPE))
                     
                     if ptype in ptypes:
                         i = ptypes.index(ptype)
-- 
GitLab