/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/classgen.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/classgen.py

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

revision 900 by jonathan, Wed May 14 11:15:41 2003 UTC revision 986 by tkoester, Thu May 22 16:41:10 2003 UTC
# Line 5  Line 5 
5  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
6  # Read the file COPYING coming with Thuban for details.  # Read the file COPYING coming with Thuban for details.
7    
8    """
9    ClassGenerator
10    """
11    
12    __version__ = "$Revision$"
13    # $Source$
14    # $Id$
15    
16  import operator  import operator
17    
18  from color import Color  from color import Color
# Line 95  class ClassGenerator: Line 103  class ClassGenerator:
103    
104              # this check guards against rounding issues              # this check guards against rounding issues
105              if cur_min != cur_max:              if cur_min != cur_max:
106                  range = Range("[" + str(float(cur_min)) + ";" +                  range = Range(("[", cur_min, cur_max, end))
                                     str(float(cur_max)) + end)  
107                  clazz.AppendGroup(ClassGroupRange(range, None, prop))                  clazz.AppendGroup(ClassGroupRange(range, None, prop))
108    
109              cur_min = cur_max              cur_min = cur_max
# Line 141  class ClassGenerator: Line 148  class ClassGenerator:
148    
149                  start, min, endMax, right = _range.GetRange()                  start, min, endMax, right = _range.GetRange()
150    
                 if str(min) == '-inf':  
                     min = "-oo"  
                 elif str(min) == 'inf':  
                     min = "oo"  
   
                 if str(endMax) == '-inf':  
                     endMax = "-oo"  
                 elif str(endMax) == 'inf':  
                     endMax = "oo"  
   
151                  oldp = 0                  oldp = 0
152                  i = 1                  i = 1
153                  end = "]"                  end = "]"
# Line 162  class ClassGenerator: Line 159  class ClassGenerator:
159                      else:                      else:
160                          max = _list[q]                          max = _list[q]
161    
162                      group = ClassGroupRange(Range(start + str(min) + ";" +                      group = ClassGroupRange(Range((start, min, max, end)),
                                                           str(max) + end),  
163                                              None, prop)                                              None, prop)
164                    
165                      group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),                      group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2),

Legend:
Removed from v.900  
changed lines
  Added in v.986

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26