/[papo]/gnue/common/src/dbdrivers/odbc/DBdriver.py
ViewVC logotype

Diff of /gnue/common/src/dbdrivers/odbc/DBdriver.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by charlie, Fri Jun 28 19:43:51 2002 UTC revision 1.1.4.1 by anthonyl, Tue Mar 4 22:09:35 2003 UTC
# Line 16  Line 16 
16  # write to the Free Software Foundation, Inc., 59 Temple Place  # write to the Free Software Foundation, Inc., 59 Temple Place
17  # - Suite 330, Boston, MA 02111-1307, USA.  # - Suite 330, Boston, MA 02111-1307, USA.
18  #  #
19  # Copyright 2000, 2001 Free Software Foundation  # Copyright 2000-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # odbc/DBdriver.py  # odbc/DBdriver.py
# Line 42  from gnue.common import GDebug, GDataObj Line 42  from gnue.common import GDebug, GDataObj
42  try:  try:
43    import dbi, odbc    import dbi, odbc
44  except ImportError, message:  except ImportError, message:
45    raise GConnections.AdapterNotInstalled, \    tmsg = _("Driver not installed: win32all ODBC driver\n\n[%s") % message
46           _("Driver not installed: win32all ODBC driver\n\n[%s") % message    raise GConnections.AdapterNotInstalled, tmsg
47    
48    
49    
# Line 394  class ODBC_DataObject(GDataObjects.DataO Line 394  class ODBC_DataObject(GDataObjects.DataO
394          for i in range(0, len(element._children)):          for i in range(0, len(element._children)):
395            element._children[i] = self.__conditionToSQL(element._children[i])            element._children[i] = self.__conditionToSQL(element._children[i])
396          if len(element._children) < self.conditionElements[otype][0]:          if len(element._children) < self.conditionElements[otype][0]:
397            raise GConditions.ConditionError, \            tmsg = _('Condition element "%s" expects at least %s arguments; found %s') % \
             _('Condition element "%s" expects at least %s arguments; found %s') % \  
398                  (otype, self.conditionElements[otype][0], len(element._children))                  (otype, self.conditionElements[otype][0], len(element._children))
399              raise GConditions.ConditionError, tmsg
400          if len(element._children) > self.conditionElements[otype][1]:          if len(element._children) > self.conditionElements[otype][1]:
401            raise GConditions.ConditionError, \            tmsg = _('Condition element "%s" expects at most %s arguments; found %s') % \
             _('Condition element "%s" expects at most %s arguments; found %s') % \  
402                  (otype, self.conditionElements[otype][0], len(element._children))                  (otype, self.conditionElements[otype][0], len(element._children))
403              raise GConditions.ConditionError, tmsg
404          if self.conditionElements[otype][3] == None:          if self.conditionElements[otype][3] == None:
405            return self.conditionElements[otype][2] % tuple(element._children)            return self.conditionElements[otype][2] % tuple(element._children)
406          else:          else:
407            return self.conditionElements[otype][2] % \            return self.conditionElements[otype][2] % \
408              (string.join(element._children, self.conditionElements[otype][3]))              (string.join(element._children, self.conditionElements[otype][3]))
409        else:        else:
410          raise GConditions.ConditionNotSupported, \          tmsg = _('Condition clause "%s" is not supported by this db driver.') % otype
411            _('Condition clause "%s" is not supported by this db driver.') % otype          raise GConditions.ConditionNotSupported, tmsg
412    
413    # Code necessary to force the connection into transaction mode...    # Code necessary to force the connection into transaction mode...
414    # this is usually not necessary (MySQL is one of few DBs that must force)    # this is usually not necessary (MySQL is one of few DBs that must force)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26