comparison MoinMoin/filter/EXIF.py @ 4729:2a55ba43afb3

filter.EXIF: reduce renamed to reduce_size (avoid name clash)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 08 May 2009 20:01:57 +0200
parents 7028ac728357
children
comparison
equal deleted inserted replaced
4701:d8049de69c4f 4729:2a55ba43afb3
1103 def __init__(self, num, den): 1103 def __init__(self, num, den):
1104 self.num = num 1104 self.num = num
1105 self.den = den 1105 self.den = den
1106 1106
1107 def __repr__(self): 1107 def __repr__(self):
1108 self.reduce() 1108 self.reduce_size()
1109 if self.den == 1: 1109 if self.den == 1:
1110 return str(self.num) 1110 return str(self.num)
1111 return '%d/%d' % (self.num, self.den) 1111 return '%d/%d' % (self.num, self.den)
1112 1112
1113 def reduce(self): 1113 def reduce_size(self):
1114 div = gcd(self.num, self.den) 1114 div = gcd(self.num, self.den)
1115 if div > 1: 1115 if div > 1:
1116 self.num = self.num / div 1116 self.num = self.num / div
1117 self.den = self.den / div 1117 self.den = self.den / div
1118 1118