commit-gnue
[Top][All Lists]
Advanced

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

gnue-common/src datasources/GConditions.py defi...


From: Jason Cater
Subject: gnue-common/src datasources/GConditions.py defi...
Date: Thu, 10 Jul 2003 19:15:26 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-common
Branch:         
Changes by:     Jason Cater <address@hidden>    03/07/10 19:15:26

Modified files:
        src/datasources: GConditions.py 
        src/definitions: GObjects.py 

Log message:
        stop designer from spitting out Char:height="1.0"

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/datasources/GConditions.py.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/definitions/GObjects.py.diff?tr1=1.60&tr2=1.61&r1=text&r2=text

Patches:
Index: gnue-common/src/datasources/GConditions.py
diff -c gnue-common/src/datasources/GConditions.py:1.24 
gnue-common/src/datasources/GConditions.py:1.25
*** gnue-common/src/datasources/GConditions.py:1.24     Mon Feb 17 02:32:48 2003
--- gnue-common/src/datasources/GConditions.py  Thu Jul 10 19:15:26 2003
***************
*** 199,204 ****
--- 199,206 ----
           'Attributes': {
              'value':     {
                 'Required': 1,
+                'Typecast': GTypecast.text },
+             'type':     {
                 'Typecast': GTypecast.text } },
           'ParentTags':  ('eq','ne','lt','le','gt','ge','add','sub','mul',
                           'div','like','notlike','between','notbetween') },
***************
*** 372,386 ****
    # set start level for stack to zero
    level=0
    for i in term:
!         
      # convert type into an object
      if conditionElements.has_key(i[0]):
        e=conditionElements[i[0]][2](parent[level])
        level=level+1
        # get parameter count
!       paramcount[level]=conditionElements[i[0]][0] 
        parent[level]=e
!     elif i[0]=="field":       
        e=GCField(parent[level], i[1])
        paramcount[level]=paramcount[level]-1
        if paramcount[level]==0:
--- 374,388 ----
    # set start level for stack to zero
    level=0
    for i in term:
! 
      # convert type into an object
      if conditionElements.has_key(i[0]):
        e=conditionElements[i[0]][2](parent[level])
        level=level+1
        # get parameter count
!       paramcount[level]=conditionElements[i[0]][0]
        parent[level]=e
!     elif i[0]=="field":
        e=GCField(parent[level], i[1])
        paramcount[level]=paramcount[level]-1
        if paramcount[level]==0:
***************
*** 389,398 ****
        e=GCConst(parent[level], i[1])
        paramcount.update({level:(paramcount[level]-1)})
        if paramcount[level]==0:
!         level=level-1    
  #    print "NAME: %s  VALUE: %s  LEVEL: %s PCOUNT: %s" % \
  #          (i[0],i[1],level,paramcount[level])
!     
    return parent[0];
  
  
--- 391,400 ----
        e=GCConst(parent[level], i[1])
        paramcount.update({level:(paramcount[level]-1)})
        if paramcount[level]==0:
!         level=level-1
  #    print "NAME: %s  VALUE: %s  LEVEL: %s PCOUNT: %s" % \
  #          (i[0],i[1],level,paramcount[level])
! 
    return parent[0];
  
  
***************
*** 441,457 ****
          result = result + \
                   buildPrefixFromTree(conditionTree._children[i])
  
!       #  
        #  check for integrity of condition
        #
        if len(conditionTree._children) < conditionElements[otype][0]:
          tmsg = _('Condition element "%s" expects at least %s arguments; found 
%s') % \
!                  (otype, conditionElements[otype][0], 
len(conditionTree._children)) 
          raise GConditions.ConditionError, tmsg
  
        if len(conditionTree._children) > conditionElements[otype][1]:
          tmsg = _('Condition element "%s" expects at most %s arguments; found 
%s') % \
!                 (otype, conditionElements[otype][1], 
len(conditionTree._children)) 
          raise GConditions.ConditionError, tmsg
  
  
--- 443,459 ----
          result = result + \
                   buildPrefixFromTree(conditionTree._children[i])
  
!       #
        #  check for integrity of condition
        #
        if len(conditionTree._children) < conditionElements[otype][0]:
          tmsg = _('Condition element "%s" expects at least %s arguments; found 
%s') % \
!                  (otype, conditionElements[otype][0], 
len(conditionTree._children))
          raise GConditions.ConditionError, tmsg
  
        if len(conditionTree._children) > conditionElements[otype][1]:
          tmsg = _('Condition element "%s" expects at most %s arguments; found 
%s') % \
!                 (otype, conditionElements[otype][1], 
len(conditionTree._children))
          raise GConditions.ConditionError, tmsg
  
  
Index: gnue-common/src/definitions/GObjects.py
diff -c gnue-common/src/definitions/GObjects.py:1.60 
gnue-common/src/definitions/GObjects.py:1.61
*** gnue-common/src/definitions/GObjects.py:1.60        Mon Jun  9 11:54:32 2003
--- gnue-common/src/definitions/GObjects.py     Thu Jul 10 19:15:26 2003
***************
*** 262,267 ****
--- 262,272 ----
            if type(val) == types.StringType:
              addl = ' %s="%s"' % (attribute.replace('__',':'), 
saxutils.escape('%s' % unicode(val,gConfig('textEncoding'))))
            else:
+             try:
+               if val == int(val):
+                 val = int(val)
+             except:
+               pass
              addl = ' %s="%s"' % (attribute.replace('__',':'), 
saxutils.escape('%s' % val))
            if len(addl) + pos > 78:
              xmlString += "\n" + " " * indent + addl




reply via email to

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