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

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

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

revision 453 by bh, Tue Mar 4 11:31:39 2003 UTC revision 462 by jonathan, Wed Mar 5 18:17:17 2003 UTC
# Line 40  RANGE_MAX  = 1 Line 40  RANGE_MAX  = 1
40  RANGE_DATA = 2  RANGE_DATA = 2
41    
42  class Classification:  class Classification:
43        """Encapsulates the classification of layer. The Classification
44        divides some kind of data into Groups which are associated with
45        properties. Later the properties can be retrieved by matching
46        data values to the appropriate group."""
47    
48      def __init__(self, layer = None, field = None):      def __init__(self, layer = None, field = None):
49          """Initialize a classification.          """Initialize a classification.
50    
51             layer -- the layer object who owns this classification             layer -- the Layer object who owns this classification
52    
53             field -- the name of the data table field that             field -- the name of the data table field that
54                      is to be used to classify layer properties                      is to be used to classify layer properties
55          """          """
56    
57          self.layer = None # stop message sending          self.layer = None
58            self.field = None
59            self.fieldType = None
60            self.groups = []
61            self.__sendMessages = False
62    
63            self.__ToggleMessages(False)
64          self.SetDefaultGroup(ClassGroupDefault())          self.SetDefaultGroup(ClassGroupDefault())
65            self.SetLayer(layer)
66          self.SetField(field)          self.SetField(field)
67    
68          self.layer = layer          self.__ToggleMessages(True)
         self.points = []  
         self.ranges = []  
         self.maps   = []  
69    
70      def __iter__(self):      def __iter__(self):
71          return ClassIterator(self.DefaultGroup,          return ClassIterator(self.groups)
72                               self.points,  
73                               self.ranges,      def __ToggleMessages(self, on):
74                               self.maps)          self.__sendMessages = on
75    
76      def __SendMessage(self, message):      def __SendMessage(self, message):
77          if self.layer is not None:          """Send the message 'message' to the parent layer."""
78            if self.__sendMessages and self.layer is not None:
79              self.layer.changed(message, self.layer)              self.layer.changed(message, self.layer)
80            
81      def SetField(self, field):      def SetField(self, field = None):
82          """Set the name of the data table field to use.          """Set the name of the data table field to use.
83                    
84             field -- if None then all values map to the default data             field -- if None then all values map to the default data
# Line 80  class Classification: Line 88  class Classification:
88              field = None              field = None
89    
90          self.field = field          self.field = field
91    
92            if self.layer is not None:
93                fieldType = self.layer.GetFieldType(field)
94            else:
95                fieldType = None
96    
97            self.SetFieldType(fieldType)
98    
99            # XXX: if fieldType comes back None then field isn't in the table!
100    
101          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
102    
103      def GetField(self):      def GetField(self):
104            """Return the name of the field."""
105          return self.field          return self.field
106    
107        def GetFieldType(self):
108            """Return the field type."""
109            return self.fieldType
110    
111        def SetFieldType(self, type):
112            self.fieldType = type
113    
114      def SetLayer(self, layer):      def SetLayer(self, layer):
115          assert(isinstance(layer, Thuban.Model.layer.Layer))          """Set the owning Layer of this classification."""
116    
117            if __debug__:
118                if layer is not None:
119                    assert(isinstance(layer, Thuban.Model.layer.Layer))
120    
121          self.layer = layer          self.layer = layer
122            self.SetField(self.GetField()) # XXX: this sync's the fieldType
123    
124          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
125    
126      def GetLayer(self):      def GetLayer(self):
127          return layer.self          """Return the parent layer."""
128            return self.layer
129    
130      def SetDefaultGroup(self, group):      def SetDefaultGroup(self, group):
131          """Set the group to be used when a value can't be classified.          """Set the group to be used when a value can't be classified.
132    
133             group -- group that the value maps to. See class description.             group -- group that the value maps to.
134          """          """
135    
136          assert(isinstance(group, ClassGroupDefault))          assert(isinstance(group, ClassGroupDefault))
137          self.DefaultGroup = group          self.AddGroup(group)
138    
139      def GetDefaultGroup(self):      def GetDefaultGroup(self):
140          return self.DefaultGroup          """Return the default group."""
141            return self.groups[0]
142    
143      #      #
144      # these SetDefault* methods are really only provided for      # these SetDefault* methods are really only provided for
# Line 112  class Classification: Line 147  class Classification:
147      #      #
148    
149      def SetDefaultFill(self, fill):      def SetDefaultFill(self, fill):
150            """Set the default fill color.
151    
152            fill -- a Color object.
153            """
154          assert(isinstance(fill, Color))          assert(isinstance(fill, Color))
155          self.DefaultGroup.GetProperties().SetFill(fill)          self.GetDefaultGroup().GetProperties().SetFill(fill)
156          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
157                    
158      def GetDefaultFill(self):      def GetDefaultFill(self):
159          return self.DefaultGroup.GetProperties().GetFill()          """Return the default fill color."""
160            return self.GetDefaultGroup().GetProperties().GetFill()
161                    
162      def SetDefaultStroke(self, stroke):      def SetDefaultLineColor(self, color):
163          assert(isinstance(stroke, Color))          """Set the default line color.
164          self.DefaultGroup.GetProperties().SetStroke(stroke)  
165            color -- a Color object.
166            """
167            assert(isinstance(color, Color))
168            self.GetDefaultGroup().GetProperties().SetLineColor(color)
169          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
170                    
171      def GetDefaultStroke(self):      def GetDefaultLineColor(self):
172          return self.DefaultGroup.GetProperties().GetStroke()          """Return the default line color."""
173            return self.GetDefaultGroup().GetProperties().GetLineColor()
174                    
175      def SetDefaultStrokeWidth(self, strokeWidth):      def SetDefaultLineWidth(self, lineWidth):
176          assert(isinstance(strokeWidth, IntType))          """Set the default line width.
177          self.DefaultGroup.GetProperties().SetStrokeWidth(strokeWidth)  
178            lineWidth -- an integer > 0.
179            """
180            assert(isinstance(lineWidth, IntType))
181            self.GetDefaultGroup().GetProperties().SetLineWidth(lineWidth)
182          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
183                    
184      def GetDefaultStrokeWidth(self):      def GetDefaultLineWidth(self):
185          return self.DefaultGroup.GetProperties().GetStrokeWidth()          """Return the default line width."""
186            return self.GetDefaultGroup().GetProperties().GetLineWidth()
187                    
188      def AddGroup(self, item):      def AddGroup(self, item):
189            """Add a new ClassGroup item to the classification.
190    
191            item -- this must be a valid ClassGroup object
192            """
193    
194          assert(isinstance(item, ClassGroup))          assert(isinstance(item, ClassGroup))
195    
196          if isinstance(item, ClassGroupDefault):          if len(self.groups) > 0 and isinstance(item, ClassGroupDefault):
197              self.SetDefaultGroup(item)              self.groups[0] = item
198          elif isinstance(item, ClassGroupSingleton):              #self.SetDefaultGroup(item)
             self.points.append(item)  
         elif isinstance(item, ClassGroupRange):  
             self.ranges.append(item)  
         elif isinstance(item, ClassGroupMap):  
             self.maps.append(item)  
199          else:          else:
200              raise ValueError(_("Unrecognized ClassGroup"))              self.groups.append(item)
201    
202          self.__SendMessage(LAYER_LEGEND_CHANGED)          self.__SendMessage(LAYER_LEGEND_CHANGED)
203    
204      def GetGroup(self, value):      def GetGroup(self, value):
205          """Return the associated data, or the default data.          """Return the associated group, or the default group.
206    
207             The following search technique is used:             Groups are checked in the order the were added to the
208                 (1) if the field is None, return the default data             Classification.
                (2) check if the value exists as a single value  
                (3) check if the value falls within a range. Ranges  
                    are checked in the order they were added to  
                    the classification.  
209    
210             value -- the value to classify. If there is no mapping,             value -- the value to classify. If there is no mapping,
211                      or value is None, return the default properties                      or value is None, return the default properties
# Line 167  class Classification: Line 213  class Classification:
213    
214          if self.field is not None and value is not None:          if self.field is not None and value is not None:
215    
216              for p in self:              for i in range(1, len(self.groups)):
217                  if p.Matches(value):                  group = self.groups[i]
218                      return p                  if group.Matches(value):
219  #           #                      return group
 #           # check the discrete values  
 #           #  
 #           if self.points.has_key(value):  
 #               return self.points[value]  
 #           #for p in self.points:  
 #               #if p.Value  
   
 #           #  
 #           # check the ranges  
 #           #  
 #           for p in self.ranges:  
 #               if p.InRange(value):  
 #                   return p  
   
 #           #  
 #           # check the maps  
 #           #  
 #           for p in self.maps:  
 #               try:  
 #                   return p.Map(value)  
 #               except: pass  
220    
221          return self.DefaultGroup          return self.GetDefaultGroup()
222    
223      def GetProperties(self, value):      def GetProperties(self, value):
224          return self.GetGroup(value).GetProperties()          """Return the properties associated with the given value."""
225    
226            group = self.GetGroup(value)
227            if isinstance(group, ClassGroupMap):
228                return group.GetPropertiesFromValue(value)
229            else:
230                return group.GetProperties()
231    
232      def TreeInfo(self):      def TreeInfo(self):
233          items = []          items = []
# Line 218  class Classification: Line 249  class Classification:
249    
250              props = group.GetProperties()              props = group.GetProperties()
251              i = []              i = []
252              v = props.GetStroke()              v = props.GetLineColor()
253              i.append(build_color_item(_("Stroke"), v))              i.append(build_color_item(_("Line Color"), v))
254              v = props.GetStrokeWidth()              v = props.GetLineWidth()
255              i.append(_("Stroke Width: %s") % v)              i.append(_("Line Width: %s") % v)
256              v = props.GetFill()              v = props.GetFill()
257              i.append(build_color_item(_("Fill"), v))              i.append(build_color_item(_("Fill"), v))
258              return (label, i)              return (label, i)
259    
260          for p in self:          for p in self:
261              if isinstance(p, ClassGroupDefault):              if isinstance(p, ClassGroupDefault):
262                  items.append(build_item(self.DefaultGroup, _("'DEFAULT'")))                  items.append(build_item(self.GetDefaultGroup(), _("'DEFAULT'")))
263              elif isinstance(p, ClassGroupSingleton):              elif isinstance(p, ClassGroupSingleton):
264                  items.append(build_item(p, str(p.GetValue())))                  items.append(build_item(p, str(p.GetValue())))
265              elif isinstance(p, ClassGroupRange):              elif isinstance(p, ClassGroupRange):
266                  items.append(build_item(p, "%s - %s" %                  items.append(build_item(p, "%s - %s" %
267                                             (p.GetMin(), p.GetMax())))                                             (p.GetMin(), p.GetMax())))
268    
 #       for p in self.points.values():  
 #           items.append(build_item(p, str(p.GetValue())))  
   
 #       for p in self.ranges:  
 #           items.append(build_item(p, "%s - %s" % (p.GetMin(), p.GetMax())))  
   
269          return (_("Classification"), items)          return (_("Classification"), items)
270    
271  class ClassIterator:  class ClassIterator:
272        """Allows the Groups in a Classifcation to be interated over.
273    
274      def __init__(self, default, points, ranges, maps):      The items are returned in the following order:
275          self.data = [default, points, ranges, maps]          default data, singletons, ranges, maps
276          self.data_iter = iter(self.data)      """
277          self.iter = None  
278        def __init__(self, data): #default, points, ranges, maps):
279            """Constructor.
280    
281            default -- the default group
282    
283            points -- a list of singleton groups
284    
285            ranges -- a list of range groups
286    
287            maps -- a list of map groups
288            """
289    
290            self.data = data #[default, points, ranges, maps]
291            self.data_index = 0
292            #self.data_iter = iter(self.data)
293            #self.iter = None
294    
295      def __iter__(self):      def __iter__(self):
296          return self          return self
297    
298      def next(self):      def next(self):
299          if self.iter is None:          """Return the next item."""
300              try:  
301                  self.data_item = self.data_iter.next()          if self.data_index >= len(self.data):
302                  self.iter = iter(self.data_item)              raise StopIteration
303              except TypeError:          else:
304                  return self.data_item              d = self.data[self.data_index]
305                self.data_index += 1
306          try:              return d
307              return self.iter.next()          
308          except StopIteration:  #       if self.iter is None:
309              self.iter = None  #           try:
310              return self.next()  #               self.data_item = self.data_iter.next()
311    #               self.iter = iter(self.data_item)
312    #           except TypeError:
313    #               return self.data_item
314    
315    #       try:
316    #           return self.iter.next()
317    #       except StopIteration:
318    #           self.iter = None
319    #           return self.next()
320                
321  class ClassGroupProperties:  class ClassGroupProperties:
322        """Represents the properties of a single Classification Group.
323      
324        These are used when rendering a layer."""
325    
326        def __init__(self, props = None):
327            """Constructor.
328    
329            props -- a ClassGroupProperties object. The class is copied if
330                     prop is not None. Otherwise, a default set of properties
331                     is created.
332            """
333    
334      def __init__(self, prop = None):          self.stroke = None
335            self.strokeWidth = 0
336            self.fill = None
337    
338          if prop is not None:          if props is not None:
339              self.SetStroke(prop.GetStroke())              self.SetProperties(props)
             self.SetStrokeWidth(prop.GetStrokeWidth())  
             self.SetFill(prop.GetFill())  
340          else:          else:
341              self.SetStroke(Color.None)              self.SetLineColor(Color.None)
342              self.SetStrokeWidth(1)              self.SetLineWidth(1)
343              self.SetFill(Color.None)              self.SetFill(Color.None)
344    
345      def GetStroke(self):      def SetProperties(self, props):
346            """Set this class's properties to those in class props."""
347    
348            assert(isinstance(props, ClassGroupProperties))
349            self.SetLineColor(props.GetLineColor())
350            self.SetLineWidth(props.GetLineWidth())
351            self.SetFill(props.GetFill())
352            
353        def GetLineColor(self):
354            """Return the line color as a Color object."""
355          return self.stroke          return self.stroke
356    
357      def SetStroke(self, stroke):      def SetLineColor(self, color):
358          assert(isinstance(stroke, Color))          """Set the line color.
         self.stroke = stroke  
   
     def GetStrokeWidth(self):  
         return self.stroke_width  
   
     def SetStrokeWidth(self, stroke_width):  
         assert(isinstance(stroke_width, IntType))  
         if (stroke_width < 1):  
             raise ValueError(_("stroke_width < 1"))  
359    
360          self.stroke_width = stroke_width          color -- the color of the line. This must be a Color object.
361            """
362    
363            assert(isinstance(color, Color))
364            self.stroke = color
365    
366        def GetLineWidth(self):
367            """Return the line width."""
368            return self.strokeWidth
369    
370        def SetLineWidth(self, lineWidth):
371            """Set the line width.
372    
373            lineWidth -- the new line width. This must be > 0.
374            """
375            assert(isinstance(lineWidth, IntType))
376            if (lineWidth < 1):
377                raise ValueError(_("lineWidth < 1"))
378    
379            self.strokeWidth = lineWidth
380    
381      def GetFill(self):      def GetFill(self):
382            """Return the fill color as a Color object."""
383          return self.fill          return self.fill
384    
385      def SetFill(self, fill):      def SetFill(self, fill):
386            """Set the fill color.
387    
388            fill -- the color of the fill. This must be a Color object.
389            """
390    
391          assert(isinstance(fill, Color))          assert(isinstance(fill, Color))
392          self.fill = fill          self.fill = fill
393    
394    
395  class ClassGroup:  class ClassGroup:
396        """A base class for all Groups within a Classification"""
397    
398      def __init__(self, label = ""):      def __init__(self, label = ""):
399          self.label = label          """Constructor.
400    
401            label -- A string representing the Group's label
402            """
403    
404            self.label = None
405    
406            self.SetLabel(label)
407    
408      def GetLabel(self):      def GetLabel(self):
409            """Return the Group's label."""
410          return self.label          return self.label
411    
412      def SetLabel(self, label):      def SetLabel(self, label):
413            """Set the Group's label.
414    
415            label -- a string representing the Group's label. This must
416                     not be None.
417            """
418            assert(isinstance(label, StringType))
419          self.label = label          self.label = label
420    
421      def Matches(self, value):      def Matches(self, value):
422          """This needs to be implemented by all subclasses."""          """Determines if this Group is associated with the given value.
423    
424            Returns True or False. This needs to be implemented by all subclasses.
425            """
426          pass          pass
427    
428      def GetProperties(self, value):      def GetProperties(self):
429          """This needs to be implemented by all subclasses."""          """Return the properties associated with the given value.
430    
431            This needs to be implemented by all subclasses.
432            """
433          pass          pass
434    
435            
436  class ClassGroupSingleton(ClassGroup):  class ClassGroupSingleton(ClassGroup):
437        """A Group that is associated with a single value."""
438    
439      def __init__(self, value = 0, prop = None, label = ""):      def __init__(self, value = 0, prop = None, label = ""):
440            """Constructor.
441    
442            value -- the associated value.
443    
444            prop -- a ClassGroupProperites object. If prop is None a default
445                     set of properties is created.
446    
447            label -- a label for this group.
448            """
449          ClassGroup.__init__(self, label)          ClassGroup.__init__(self, label)
450    
451            self.prop = None
452            self.value = None
453    
454          self.SetValue(value)          self.SetValue(value)
455          self.SetProperties(prop)          self.SetProperties(prop)
456    
# Line 337  class ClassGroupSingleton(ClassGroup): Line 458  class ClassGroupSingleton(ClassGroup):
458          return ClassGroupSingleton(self.value, self.prop, self.label)          return ClassGroupSingleton(self.value, self.prop, self.label)
459    
460      def GetValue(self):      def GetValue(self):
461            """Return the associated value."""
462          return self.value          return self.value
463    
464      def SetValue(self, value):      def SetValue(self, value):
465            """Associate this Group with the given value."""
466          self.value = value          self.value = value
467    
468      def Matches(self, value):      def Matches(self, value):
469            """Determine if the given value matches the associated Group value."""
470    
471            """Returns True if the value matches, False otherwise."""
472    
473          return self.value == value          return self.value == value
474    
475      def GetProperties(self, value = None):      def GetProperties(self):
476          if value is None: return self.prop          """Return the Properties associated with this Group."""
477    
478          if self.Matches(value):          return self.prop
             return self.prop  
         else:  
             return None  
479    
480      def SetProperties(self, prop):      def SetProperties(self, prop):
481            """Set the properties associated with this Group.
482    
483            prop -- a ClassGroupProperties object. if prop is None,
484                    a default set of properties is created.
485            """
486    
487          if prop is None: prop = ClassGroupProperties()          if prop is None: prop = ClassGroupProperties()
488          assert(isinstance(prop, ClassGroupProperties))          assert(isinstance(prop, ClassGroupProperties))
489          self.prop = prop          self.prop = prop
490    
491    
492  class ClassGroupDefault(ClassGroupSingleton):  class ClassGroupDefault(ClassGroupSingleton):
493        """The default Group. When values do not match any other
494           Group within a Classification, the properties from this
495           class are used."""
496    
497      def __init__(self, prop = None, label = ""):      def __init__(self, prop = None, label = ""):
498            """Constructor.
499    
500            prop -- a ClassGroupProperites object. If prop is None a default
501                     set of properties is created.
502    
503            label -- a label for this group.
504            """
505    
506          ClassGroupSingleton.__init__(self, 0, prop, label)          ClassGroupSingleton.__init__(self, 0, prop, label)
507    
508      def __copy__(self):      def __copy__(self):
509          return ClassGroupDefault(self.prop, self.label)          return ClassGroupDefault(self.prop, self.label)
510    
511      def GetProperties(self, value = None):      def GetProperties(self):
512            """Return the Properties associated with this Group."""
513          return self.prop          return self.prop
514    
515  class ClassGroupRange(ClassGroup):  class ClassGroupRange(ClassGroup):
516        """A Group that represents a range of values that map to the same
517           set of properties."""
518    
519      def __init__(self, min = 0, max = 1, prop = None, label = ""):      def __init__(self, min = 0, max = 1, prop = None, label = ""):
520            """Constructor.
521    
522            The minumum value must be strictly less than the maximum.
523    
524            min -- the minimum range value
525    
526            max -- the maximum range value
527    
528            prop -- a ClassGroupProperites object. If prop is None a default
529                     set of properties is created.
530    
531            label -- a label for this group.
532            """
533    
534          ClassGroup.__init__(self, label)          ClassGroup.__init__(self, label)
535    
536            self.min = self.max = 0
537            self.prop = None
538    
539          self.SetRange(min, max)          self.SetRange(min, max)
540          self.SetProperties(prop)          self.SetProperties(prop)
541    
# Line 381  class ClassGroupRange(ClassGroup): Line 543  class ClassGroupRange(ClassGroup):
543          return ClassGroupRange(self.min, self.max, self.prop, self.label)          return ClassGroupRange(self.min, self.max, self.prop, self.label)
544    
545      def GetMin(self):      def GetMin(self):
546            """Return the range's minimum value."""
547          return self.min          return self.min
548    
549      def SetMin(self, min):      def SetMin(self, min):
550            """Set the range's minimum value.
551        
552            min -- the new minimum. Note that this must be less than the current
553                   maximum value. Use SetRange() to change both min and max values.
554            """
555        
556          self.SetRange(min, self.max)          self.SetRange(min, self.max)
557    
558      def GetMax(self):      def GetMax(self):
559            """Return the range's maximum value."""
560          return self.max          return self.max
561    
562      def SetMax(self, max):      def SetMax(self, max):
563            """Set the range's maximum value.
564        
565            max -- the new maximum. Note that this must be greater than the current
566                   minimum value. Use SetRange() to change both min and max values.
567            """
568          self.SetRange(self.min, max)          self.SetRange(self.min, max)
569    
570      def SetRange(self, min, max):      def SetRange(self, min, max):
571            """Set a new range.
572    
573            Note that min must be strictly less than max.
574    
575            min -- the new minimum value
576            min -- the new maximum value
577            """
578    
579          if min >= max:          if min >= max:
580              raise ValueError(_("ClassGroupRange: %i(min) >= %i(max)!") %              raise ValueError(_("ClassGroupRange: %i(min) >= %i(max)!") %
581                               (min, max))                               (min, max))
# Line 400  class ClassGroupRange(ClassGroup): Line 583  class ClassGroupRange(ClassGroup):
583          self.max = max          self.max = max
584    
585      def GetRange(self):      def GetRange(self):
586            """Return the range as a tuple (min, max)"""
587          return (self.min, self.max)          return (self.min, self.max)
588    
589      def Matches(self, value):      def Matches(self, value):
590          return self.min <= value < self.max          """Determine if the given value lies with the current range.
591    
592      def GetProperties(self, value = None):          The following check is used: min <= value < max.
593          if value is None: return self.prop          """
594    
595          if self.Matches(value):          return self.min <= value < self.max
596              return self.prop  
597          else:      def GetProperties(self):
598              return None          """Return the Properties associated with this Group."""
599            return self.prop
600    
601      def SetProperties(self, prop):      def SetProperties(self, prop):
602            """Set the properties associated with this Group.
603    
604            prop -- a ClassGroupProperties object. if prop is None,
605                    a default set of properties is created.
606            """
607          if prop is None: prop = ClassGroupProperties()          if prop is None: prop = ClassGroupProperties()
608          assert(isinstance(prop, ClassGroupProperties))          assert(isinstance(prop, ClassGroupProperties))
609          self.prop = prop          self.prop = prop
610    
611  class ClassGroupMap(ClassGroup):  class ClassGroupMap(ClassGroup):
612        """Currently, this class is not used."""
613    
614      FUNC_ID = "id"      FUNC_ID = "id"
615    
616      def __init__(self, map_type = FUNC_ID, func = None, prop = None, label=""):      def __init__(self, map_type = FUNC_ID, func = None, prop = None, label=""):
617          ClassGroup.__init__(self, prop)          ClassGroup.__init__(self, label)
618    
619          self.map_type = map_type          self.map_type = map_type
620          self.func = func          self.func = func
# Line 434  class ClassGroupMap(ClassGroup): Line 625  class ClassGroupMap(ClassGroup):
625      def Map(self, value):      def Map(self, value):
626          return self.func(value)          return self.func(value)
627    
628        def GetProperties(self):
629            return None
630    
631        def GetPropertiesFromValue(self, value):
632            pass
633    
634      #      #
635      # built-in mappings      # built-in mappings
636      #      #

Legend:
Removed from v.453  
changed lines
  Added in v.462

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26