Rename Bounds.merge to Bounds.update.

debian-sid
Tom Payne 15 years ago
parent 4d55321f1f
commit 53aa350e29

@ -33,7 +33,7 @@ class Track(object):
self.bounds = util.BoundsSet()
self.bounds.ele = util.Bounds(self.coords[0].ele)
for coord in self.coords:
self.bounds.ele.merge(coord.ele)
self.bounds.ele.update(coord.ele)
self.bounds.time = util.Bounds((self.times[0], self.times[-1]))
self.elevation_data = self.bounds.ele.min != 0 or self.bounds.ele.max != 0
self.s = [0.0]

@ -23,7 +23,7 @@ class Bounds(object):
def __repr__(self):
return 'Bounds((%(min)s, %(max)s))' % self.__dict__
def merge(self, value):
def update(self, value):
if isinstance(value, Bounds):
if value.min < self.min:
self.min = value.min
@ -41,10 +41,10 @@ class Bounds(object):
class BoundsSet(object):
def merge(self, other):
def update(self, other):
for key, value in other.__dict__.items():
if hasattr(self, key):
getattr(self, key).merge(value)
getattr(self, key).update(value)
else:
setattr(self, key, value)

Loading…
Cancel
Save