Tweaks to use inplace arithmetic
svn: r13191
This commit is contained in:
@@ -87,11 +87,11 @@ class Citation(object):
|
||||
number_of_letters = int(math.log(float(ref_count), float(letter_count)))+1
|
||||
# Exclude index for number_of_letters-1
|
||||
for n in range(1, number_of_letters-1):
|
||||
ref_count = ref_count - pow(letter_count, n)
|
||||
ref_count -= pow(letter_count, n)
|
||||
# Adjust number_of_letters for new index
|
||||
number_of_letters = int(math.log(float(ref_count), float(letter_count))) +1
|
||||
for n in range(1, number_of_letters):
|
||||
x_ref_count = x_ref_count - pow(letter_count, n)
|
||||
x_ref_count -= pow(letter_count, n)
|
||||
for letter in range(1, number_of_letters):
|
||||
index = x_ref_count / pow(letter_count, letter) % letter_count
|
||||
key += string.ascii_lowercase[ index ]
|
||||
|
||||
@@ -70,7 +70,7 @@ class _DrawFormatComboBox(gtk.ComboBox):
|
||||
self.store.append(row=[name])
|
||||
if plugin.get_extension() == active:
|
||||
active_index = index
|
||||
index = index + 1
|
||||
index += 1
|
||||
self.set_active(active_index)
|
||||
|
||||
def get_active_plugin(self):
|
||||
|
||||
@@ -871,7 +871,7 @@ class GraphvizFormatComboBox(gtk.ComboBox):
|
||||
self.store.append(row=[name])
|
||||
if item['type'] == active:
|
||||
active_index = index
|
||||
index = index + 1
|
||||
index += 1
|
||||
self.set_active(active_index)
|
||||
|
||||
def get_label(self):
|
||||
|
||||
@@ -370,7 +370,7 @@ class ReportDialog(ManagedWindow.ManagedWindow):
|
||||
else:
|
||||
table.attach(widget, 2, 3, row, row+1,
|
||||
yoptions=gtk.SHRINK)
|
||||
row = row + 1
|
||||
row += 1
|
||||
|
||||
def setup_main_options(self):
|
||||
if "" in self.frames:
|
||||
|
||||
@@ -1533,7 +1533,7 @@ def draw_wedge(doc, style, centerx, centery, radius, start_angle,
|
||||
x = centerx + cos(angle) * short_radius
|
||||
y = centery + sin(angle) * short_radius
|
||||
p.append((x, y))
|
||||
angle = angle - radiansdelta
|
||||
angle -= radiansdelta
|
||||
doc.draw_path(style, p)
|
||||
|
||||
delta = (eangle - sangle) / 2.0
|
||||
|
||||
@@ -122,7 +122,7 @@ class StyleListDisplay(object):
|
||||
if style == "default":
|
||||
continue
|
||||
self.list.add([style])
|
||||
index = index + 1
|
||||
index += 1
|
||||
|
||||
def on_add_clicked(self, obj):
|
||||
"""Called with the ADD button is clicked. Invokes the StyleEditor to
|
||||
|
||||
@@ -71,7 +71,7 @@ class _TextFormatComboBox(gtk.ComboBox):
|
||||
self.store.append(row=[name])
|
||||
if plugin.get_extension() == active:
|
||||
active_index = index
|
||||
index = index + 1
|
||||
index += 1
|
||||
self.set_active(active_index)
|
||||
|
||||
def get_active_plugin(self):
|
||||
|
||||
Reference in New Issue
Block a user