commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r6178 - in trunk/gnue-common/src/datasources: . drivers/Base drivers/DBS


From: johannes
Subject: r6178 - in trunk/gnue-common/src/datasources: . drivers/Base drivers/DBSIG2
Date: Mon, 9 Aug 2004 08:35:02 -0500 (CDT)

Author: johannes
Date: 2004-08-09 08:35:01 -0500 (Mon, 09 Aug 2004)
New Revision: 6178

Modified:
   trunk/gnue-common/src/datasources/GConditions.py
   trunk/gnue-common/src/datasources/GConnections.py
   trunk/gnue-common/src/datasources/GDataSource.py
   trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
   trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
Log:
Fixed some messages


Modified: trunk/gnue-common/src/datasources/GConditions.py
===================================================================
--- trunk/gnue-common/src/datasources/GConditions.py    2004-08-09 12:13:21 UTC 
(rev 6177)
+++ trunk/gnue-common/src/datasources/GConditions.py    2004-08-09 13:35:01 UTC 
(rev 6178)
@@ -1261,8 +1261,9 @@
       #  check for integrity of condition
       #
       if len(conditionTree._children) < conditionElements[otype][0]:
-        tmsg = u_('Condition element "%s" expects at least %s arguments; found 
%s') % \
-                 (otype, conditionElements[otype][0], 
len(conditionTree._children))
+        tmsg = u_("Condition element \"%s\" expects at least %s arguments; "
+                  "found %s") % \
+             (otype, conditionElements[otype][0], len(conditionTree._children))
         raise ConditionError, tmsg
 
       if len(conditionTree._children) > conditionElements[otype][1]:

Modified: trunk/gnue-common/src/datasources/GConnections.py
===================================================================
--- trunk/gnue-common/src/datasources/GConnections.py   2004-08-09 12:13:21 UTC 
(rev 6177)
+++ trunk/gnue-common/src/datasources/GConnections.py   2004-08-09 13:35:01 UTC 
(rev 6178)
@@ -97,15 +97,16 @@
       try:
         self._parser.readfp(fileHandle)
       except DuplicateSectionError:
-        tmsg =  _('The connections file has duplicate source 
definitions.\n\nFile: %s') \
-              % location
+        tmsg =  u_("The connections file has duplicate source definitions."
+                   "\n\nFile: %s") % location
         raise InvalidFormatError, tmsg
       except MissingSectionHeaderError:
-        tmsg = _('The connections file has no source definitions.\n\nFile: 
%s') \
-              % location
+        tmsg = u_("The connections file has no source definitions."
+                  "\n\nFile: %s") % location
         raise InvalidFormatError, tmsg
       except:
-        tmsg =  _('The connections file cannot be parsed.\n\nFile: %s') % 
location
+        tmsg =  u_("The connections file cannot be parsed."
+                   "\n\nFile: %s") % location
         raise InvalidFormatError, tmsg
 
     self._openConnections = {}
@@ -158,8 +159,10 @@
       except:
         return default
     except KeyError:
-      tmsg = _('The connections file does not contain a definition \n       
for "%s".\n\nFile: %s') \
-            % (connection_name, self._location)
+      tmsg = u_("The connections file does not contain a definition "
+                "for \"%(connection)s\".\n\nFile: %(file)s") \
+             % {'connection': connection_name,
+                'file'      : self._location}
       raise NotFoundError, tmsg
 
 
@@ -193,8 +196,10 @@
     try:
       return copy.deepcopy(self._definitions[connection_name])
     except KeyError:
-      tmsg = _('The connections file does not contain a definition \n       
for "%s".\n\nFile: %s') \
-            % (connection_name, self._location)
+      tmsg = u_("The connections file does not contain a definition "
+                "for \"%(connection)s\".\n\nFile: %(file)s") \
+             % {'connection': connection_name,
+                'file'      : self._location}
       raise NotFoundError, tmsg
 
 
@@ -296,7 +301,10 @@
       GDebug.printMesg (1,'Attaching to %s (%s)' % (dd.__class__.__name__, 
connection_type))
       return dd
     except KeyError:
-      tmsg = _("DB Driver '%s' does not support source type '%s'") % 
(connection, connection_type)
+      tmsg = u_("DB Driver '%(connection)s' does not support source type "
+                "'%(conType)s'") \
+             % {'connection': connection,
+                'conType': connection_type}
       raise Exceptions.ObjectTypeNotAvailableError, tmsg
 
 
@@ -450,7 +458,8 @@
             if not attempts:
               # Four times is plenty...
               #self._loginHandler.destroyLoginDialog()
-              tmsg = _("Unable to log in after 4 attempts.\n\nError: %s") % 
error
+              tmsg = u_("Unable to log in after 4 attempts.\n\nError: %s") \
+                     % error
               raise Exceptions.LoginError, tmsg
 
           except GLoginHandler.UserCanceledLogin:

Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2004-08-09 12:13:21 UTC 
(rev 6177)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2004-08-09 13:35:01 UTC 
(rev 6178)
@@ -242,10 +242,12 @@
 
     if self.type == "sql" and not hasRaw:
       raise Exceptions.InvalidDatasourceDefintion, \
-        _("Datasource %s is sql-based, but has no <sql> definition.") % 
self.name
+        u_("Datasource %s is sql-based, but has no <sql> definition.") \
+        % self.name
     elif not self.type == "sql" and hasRaw:
       raise Exceptions.InvalidDatasourceDefintion, \
-        _("Datasource %s is not sql-based, but has a <sql> definition.") % 
self.name
+        u_("Datasource %s is not sql-based, but has a <sql> definition.") \
+        % self.name
 
 
     # Copy all attributes from XML to the dataObject
@@ -360,8 +362,10 @@
             .getDataObject().addDetailDataObject(self.getDataObject(),
                                                  self)
       else:
-        tmsg = _("Detail source '%s' references non-existant master '%s'") \
-                         % (self.name, self.master)
+        tmsg = u_("Detail source '%(source)s' references non-existant master "
+                  "'%(master)s'") \
+               % {'source': self.name,
+                  'master': self.master}
         raise StandardError, tmsg
 
   def tertiaryInit(self):

Modified: trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2004-08-09 12:13:21 UTC (rev 6177)
+++ trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2004-08-09 13:35:01 UTC (rev 6178)
@@ -129,7 +129,7 @@
                                  string.lower(dataObject.detaillink) or "", 
',')
 
     if len(dataObject._masterfields) != len(dataObject._detailfields):
-      tmsg = _("master=%s; detail=%s") % (dataObject._masterfields, 
dataObject._detailfields)
+      tmsg = u_("master=%s; detail=%s") % (dataObject._masterfields, 
dataObject._detailfields)
       raise Exceptions.MasterDetailFieldMismatch, tmsg
 
     # Make sure "master" fields will be in our future query

Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2004-08-09 
12:13:21 UTC (rev 6177)
+++ trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2004-08-09 
13:35:01 UTC (rev 6178)
@@ -139,7 +139,7 @@
     # generate an error.
     if self._parent.isFieldBound(field) and self._parent.isReadOnly():
       # Provide better feedback??
-      tmsg = _("Attempted to modify read only field '%s'") % field
+      tmsg = u_("Attempted to modify read only field '%s'") % field
       raise Exceptions.ReadOnlyError, tmsg
     else:
       # -- start quote

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py      
2004-08-09 12:13:21 UTC (rev 6177)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py      
2004-08-09 13:35:01 UTC (rev 6178)
@@ -161,7 +161,7 @@
           return 'FALSE'
 
       else:
-        err = _("Object of unknown type (%s) passed to DBSIG2 based 
dbdriver.") % type(value)
+        err = u_("Object of unknown type (%s) passed to DBSIG2 based 
dbdriver.") % type(value)
         # FIXME: raise an error instead of just printing a warning, after some 
transition time
         #raise GDataObjects.UnknownDataType, err
         GDebug.printMesg (0,err)
@@ -264,11 +264,11 @@
            result[1] == 'NULL':
            otype = "__is%s" % otype
         if len(result) < self.conditionElements[otype][0]:
-          tmsg = _('Condition element "%s" expects at least %s arguments; 
found %s') % \
+          tmsg = u_('Condition element "%s" expects at least %s arguments; 
found %s') % \
                 (otype, self.conditionElements[otype][0], len(result))
           raise GConditions.ConditionError, tmsg
         if len(result) > self.conditionElements[otype][1]:
-          tmsg = _('Condition element "%s" expects at most %s arguments; found 
%s') % \
+          tmsg = u_('Condition element "%s" expects at most %s arguments; 
found %s') % \
                 (otype, self.conditionElements[otype][0], len(result))
           raise GConditions.ConditionError, tmsg
 
@@ -278,7 +278,7 @@
           return self.conditionElements[otype][2] % \
             (string.join(result, self.conditionElements[otype][3]))
       else:
-        tmsg = _('Condition clause "%s" is not supported by this db driver.') 
% otype
+        tmsg = u_('Condition clause "%s" is not supported by this db driver.') 
% otype
         raise Exceptions.ConditionNotSupported, tmsg
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]