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

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

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

revision 1.1 by styxman, Fri Nov 15 15:32:55 2002 UTC revision 1.1.2.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  # config/DBdriver.py  # config/DBdriver.py
# Line 79  class Configfile_RecordSet(GDataObjects. Line 79  class Configfile_RecordSet(GDataObjects.
79                
80        # check if name already exists        # check if name already exists
81        if section in dataCon.sections():        if section in dataCon.sections():
82          raise Configfile_Error,"The section name you have provided for"+\          tmsg = _("The section name you have provided for this record already exists.")
83                " this record already exists."          raise Configfile_Error, tmsg
84    
85        # check if name is empty        # check if name is empty
86        if len(section)<1:              if len(section)<1:      
87          raise Configfile_Error,"You have to provide a section name for"+\          tmsg = _("You have to provide a section name for this record!")
88                " this record!"          raise Configfile_Error, tmsg
89                
90        dataCon.add_section(section)        dataCon.add_section(section)
91                
# Line 100  class Configfile_RecordSet(GDataObjects. Line 100  class Configfile_RecordSet(GDataObjects.
100                    
101          # check if name already exists          # check if name already exists
102          if newsection in dataCon.sections():          if newsection in dataCon.sections():
103            raise Configfile_Error,"The section name you have provided for"+\            tmsg = _("The section name you have provided for this record already exists.")
104                  " this record already exists."            raise Configfile_Error, tmsg
105                    
106          # check if name is empty          # check if name is empty
107            
108          if len(newsection)<1:                if len(newsection)<1:      
109            raise Configfile_Error,"You have to provide a section name for"+\            tmsg = _("You have to provide a section name for this record!")
110                  " this record!"            raise Configfile_Error, tmsg
111                    
112          # add new section          # add new section
113          dataCon.add_section(newsection)          dataCon.add_section(newsection)
# Line 274  class Configfile_DataObject(GDataObjects Line 275  class Configfile_DataObject(GDataObjects
275        file.close()        file.close()
276    
277      except:      except:
278        raise GDataObjects.ConnectionError, "Error opening config file %s" % self._filename        tmsg = _("Error opening config file %s") % self._filename
279          raise GDataObjects.ConnectionError, tmsg
280    
281        
282      self.triggerExtensions = TriggerExtensions(self._dataConnection)      self.triggerExtensions = TriggerExtensions(self._dataConnection)
# Line 296  class Configfile_DataObject(GDataObjects Line 298  class Configfile_DataObject(GDataObjects
298                         masterRecordSet=None,sql=""):                         masterRecordSet=None,sql=""):
299            
300      if conditions!=None:      if conditions!=None:
301        raise GDataObjects.ConnectionError, "This database driver always shows"+\        tmsg = _("This database driver always shows all sections\
302              " all sections of a config file. You cannot execute querys on it."               of a config file. You cannot execute querys on it.")
303          raise GDataObjects.ConnectionError, tmsg
304      result=[]      result=[]
305      for section in self._dataConnection.sections():      for section in self._dataConnection.sections():
306        record={"_section_name":section}        record={"_section_name":section}

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

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