Tweaks to use inplace arithmetic

svn: r13191
This commit is contained in:
Gerald Britton
2009-09-10 18:49:48 +00:00
parent d5e48cda06
commit 941fff23ae
31 changed files with 56 additions and 60 deletions

View File

@@ -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 ]

View File

@@ -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):

View File

@@ -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):

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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):