commit-gnue
[Top][All Lists]
Advanced

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

gnue/common/src GParser.py


From: Jason Cater
Subject: gnue/common/src GParser.py
Date: Thu, 26 Dec 2002 20:00:34 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/12/26 20:00:34

Modified files:
        common/src     : GParser.py 

Log message:
        removed i18n from 'raise' statements, as they don't work there :(

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GParser.py.diff?tr1=1.56&tr2=1.57&r1=text&r2=text

Patches:
Index: gnue/common/src/GParser.py
diff -c gnue/common/src/GParser.py:1.56 gnue/common/src/GParser.py:1.57
*** gnue/common/src/GParser.py:1.56     Thu Dec 26 19:56:57 2002
--- gnue/common/src/GParser.py  Thu Dec 26 20:00:34 2002
***************
*** 109,117 ****
    object = dh.getRoot()
  
    if not object:
!     raise MarkupError, _("Error loading %s: empty definition file") % 
(xmlFileType)
    elif object._type != rootType:
!     raise MarkupError, _("Error loading %s: not a valid %s definition 
(expected: %s, got: %s)") % (xmlFileType,
           xmlFileType, rootType, object._type)
  
    dh.finalValidation()
--- 109,117 ----
    object = dh.getRoot()
  
    if not object:
!     raise MarkupError, "Error loading %s: empty definition file" % 
(xmlFileType)
    elif object._type != rootType:
!     raise MarkupError, "Error loading %s: not a valid %s definition 
(expected: %s, got: %s)" % (xmlFileType,
           xmlFileType, rootType, object._type)
  
    dh.finalValidation()
***************
*** 225,231 ****
  
      for element in self._requiredTags:
        if self._tagCounts[element] < 1:
!         raise MarkupError, _("File is missing required tag <%s>") % (element)
  
  
    #
--- 225,231 ----
  
      for element in self._requiredTags:
        if self._tagCounts[element] < 1:
!         raise MarkupError, "File is missing required tag <%s>" % (element)
  
  
    #
***************
*** 246,252 ****
        try:
          baseAttrs = self.xmlElements[name].get('Attributes',{})
        except KeyError:
!         raise MarkupError, _('Error processing <%s> tag [I do not know what a 
<%s> tag does]') % (name, name)
  
        xmlns = {}
  
--- 246,252 ----
        try:
          baseAttrs = self.xmlElements[name].get('Attributes',{})
        except KeyError:
!         raise MarkupError, 'Error processing <%s> tag [I do not know what a 
<%s> tag does]' % (name, name)
  
        xmlns = {}
  
***************
*** 263,269 ****
  
          if attrns:
            if not self.xmlNamespaceAttributesAsPrefixes:
!             raise "Unexpected namespace an attribute"
            prefix = attrns.split(':')[-1] + '__' + attr
            attrs[prefix] = saxattrs[qattr]
            xmlns[prefix] = attrns
--- 263,269 ----
  
          if attrns:
            if not self.xmlNamespaceAttributesAsPrefixes:
!             raise "Unexpected namespace on attribute"
            prefix = attrns.split(':')[-1] + '__' + attr
            attrs[prefix] = saxattrs[qattr]
            xmlns[prefix] = attrns
***************
*** 275,288 ****
              attrs[attr] = 
baseAttrs[attr].get('Typecast',GTypecast.text)(saxattrs[qattr].encode(encoding))
 # default(baseAttrs[attr],'Typecast',GTypecast.text)(saxattrs[qattr])
              loadedxmlattrs[attr] = attrs[attr]
            except KeyError:
!             raise MarkupError, _('Error processing <%s> tag [I do not 
recognize the "%s" attribute') % (name, attr)
            except:
!             raise MarkupError, _('Error processing <%s> tag [invalid type for 
"%s" attribute; value is "%s"]') % (name, attr, saxattrs[qattr])
  
            # If this attribute must be unique, check for duplicates
            if baseAttrs[attr].get('Unique',0): # default 
(baseAttrs[attr],'Unique',0):
              if self.uniqueIDs.has_key('%s' % (saxattrs[qattr])):
!               raise MarkupError, _('Error processing <%s> tag ["%s" attribute 
should be unique; duplicate value is "%s"]') % (name, attr, saxattrs[qattr])
  
        for attr in baseAttrs.keys():
          if not attrs.has_key(attr):
--- 275,288 ----
              attrs[attr] = 
baseAttrs[attr].get('Typecast',GTypecast.text)(saxattrs[qattr].encode(encoding))
 # default(baseAttrs[attr],'Typecast',GTypecast.text)(saxattrs[qattr])
              loadedxmlattrs[attr] = attrs[attr]
            except KeyError:
!             raise MarkupError, 'Error processing <%s> tag [I do not recognize 
the "%s" attribute' % (name, attr)
            except:
!             raise MarkupError, 'Error processing <%s> tag [invalid type for 
"%s" attribute; value is "%s"]' % (name, attr, saxattrs[qattr])
  
            # If this attribute must be unique, check for duplicates
            if baseAttrs[attr].get('Unique',0): # default 
(baseAttrs[attr],'Unique',0):
              if self.uniqueIDs.has_key('%s' % (saxattrs[qattr])):
!               raise MarkupError, 'Error processing <%s> tag ["%s" attribute 
should be unique; duplicate value is "%s"]' % (name, attr, saxattrs[qattr])
  
        for attr in baseAttrs.keys():
          if not attrs.has_key(attr):
***************
*** 293,299 ****
  
            # Check for missing required attributes
            elif baseAttrs[attr].get('Required', 0): #default(baseAttrs[attr], 
'Required', 0):
!             raise MarkupError, _('Error processing <%s> tag [required 
attribute "%s" not present]') % (name, attr)
  
        attrs['_xmlnamespaces'] = xmlns
  
--- 293,299 ----
  
            # Check for missing required attributes
            elif baseAttrs[attr].get('Required', 0): #default(baseAttrs[attr], 
'Required', 0):
!             raise MarkupError, 'Error processing <%s> tag [required attribute 
"%s" not present]' % (name, attr)
  
        attrs['_xmlnamespaces'] = xmlns
  
***************
*** 304,310 ****
          object = self.xmlElements[name]['BaseClass']()
          self.root = object
          self.bootstrapflag = 1
!       
        self._tagCounts[name] += 1
  
        object._xmltag = name
--- 304,310 ----
          object = self.xmlElements[name]['BaseClass']()
          self.root = object
          self.bootstrapflag = 1
! 
        self._tagCounts[name] += 1
  
        object._xmltag = name



reply via email to

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