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

Diff of /gnue/common/src/dbdrivers/geas/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:34 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  # geas/DBdriver.py  # geas/DBdriver.py
# Line 144  class GEAS_DataObject(GDataObjects.DataO Line 144  class GEAS_DataObject(GDataObjects.DataO
144        self.ior = open(gConfig('GEASDIR')+"/var/run/geas-server.ior").readline()        self.ior = open(gConfig('GEASDIR')+"/var/run/geas-server.ior").readline()
145      except (IOError), ex:      except (IOError), ex:
146        GDebug.printMesg(1, "*** Error: ior file for geas was not found...  is geas running?")        GDebug.printMesg(1, "*** Error: ior file for geas was not found...  is geas running?")
147        raise GDataObjects.LoginError, _('Unable to connect to GEAS. Is it running?')        tmsg = _('Unable to connect to GEAS. Is it running?')
148          raise GDataObjects.LoginError, tmsg
149    
150      self._factory = self.orb.string_to_object(self.ior)      self._factory = self.orb.string_to_object(self.ior)
151      try:      try:
# Line 230  class GEAS_DataObject(GDataObjects.DataO Line 231  class GEAS_DataObject(GDataObjects.DataO
231                for i in range(0, len(conditionTree._children)):                for i in range(0, len(conditionTree._children)):
232                    conditionTree._children[i] = self.__conditionToGEASQuery(queryObject,conditionTree._children[i])                    conditionTree._children[i] = self.__conditionToGEASQuery(queryObject,conditionTree._children[i])
233                if len(conditionTree._children) < self.conditionElements[otype][0]:                if len(conditionTree._children) < self.conditionElements[otype][0]:
234                    raise GConditions.ConditionError, \                    tmsg = _('Condition element "%s" expects at least %s arguments; found %s') % \
235                          _('Condition element "%s" expects at least %s arguments; found %s') % \                           (otype, self.conditionElements[otype][0], len(conditionTree._children))
236                          (otype, self.conditionElements[otype][0], len(conditionTree._children))                    raise GConditions.ConditionError, tmsg
237                if len(conditionTree._children) > self.conditionElements[otype][1]:                if len(conditionTree._children) > self.conditionElements[otype][1]:
238                    raise GConditions.ConditionError, \                    tmsg = _('Condition element "%s" expects at most %s arguments; found %s') % \
239                          _('Condition element "%s" expects at most %s arguments; found %s') % \                           (otype, self.conditionElements[otype][0], len(conditionTree._children))
240                          (otype, self.conditionElements[otype][0], len(conditionTree._children))                    raise GConditions.ConditionError, tmsg
241                if self.conditionElements[otype][3] == None:                if self.conditionElements[otype][3] == None:
242                    eval(self.conditionElements[otype][2] % tuple(conditionTree._children))                    eval(self.conditionElements[otype][2] % tuple(conditionTree._children))
243                else:                else:
244                    eval(self.conditionElements[otype][3])                    eval(self.conditionElements[otype][3])
245                              # It's an unsupported condition so flag an error                              # It's an unsupported condition so flag an error
246            else:            else:
247                raise GConditions.ConditionNotSupported, \                tmsg = _('Condition clause "%s" is not supported by this db driver.') % otype
248                      _('Condition clause "%s" is not supported by this db driver.') % otype                raise GConditions.ConditionNotSupported, tmsg
249                                
250            #print " "*count, conditionTree._type," : ", conditionTree.getValue()            #print " "*count, conditionTree._type," : ", conditionTree.getValue()
251            #for i in range(0, len(conditionTree._children)):            #for i in range(0, len(conditionTree._children)):

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