[gnome-applets] invest: remove a superfluous argument
- From: Callum McKenzie <callum src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-applets] invest: remove a superfluous argument
- Date: Fri, 10 Jul 2009 09:01:19 +0000 (UTC)
commit 8b0a283e1bb7aee43a7b97cf0d6cae1810b29b9a
Author: Callum McKenzie <callum spooky-possum org>
Date: Fri Jul 10 19:56:41 2009 +1200
invest: remove a superfluous argument
Patch from Enrico Minack. Fixes bug 555789.
invest-applet/invest/preferences.py | 40 +++++++++++++++++-----------------
1 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/invest-applet/invest/preferences.py b/invest-applet/invest/preferences.py
index eece05b..4f63321 100644
--- a/invest-applet/invest/preferences.py
+++ b/invest-applet/invest/preferences.py
@@ -13,7 +13,7 @@ class PrefsDialog:
self.dialog = self.ui.get_object("preferences")
self.treeview = self.ui.get_object("stocks")
-
+
self.ui.get_object("add").connect('clicked', self.on_add_stock)
self.ui.get_object("add").connect('activate', self.on_add_stock)
self.ui.get_object("remove").connect('clicked', self.on_remove_stock)
@@ -25,13 +25,13 @@ class PrefsDialog:
store = gtk.ListStore(*self.typs)
self.treeview.set_model(store)
self.model = store
-
+
def on_cell_edited(cell, path, new_text, col, typ):
try:
store[path][col] = typ(new_text)
except:
pass
-
+
def get_cell_data(column, cell, model, iter, data):
typ, col = data
if typ == int:
@@ -40,7 +40,7 @@ class PrefsDialog:
cell.set_property('text', "%.2f" % typ(model[iter][col]))
else:
cell.set_property('text', typ(model[iter][col]))
-
+
def create_cell (view, column, name, typ):
cell_description = gtk.CellRendererText ()
cell_description.set_property("editable", True)
@@ -51,10 +51,10 @@ class PrefsDialog:
if typ == float:
column_description.set_cell_data_func(cell_description, get_cell_data, (float, column))
view.append_column(column_description)
-
+
for n in xrange (0, 4):
- create_cell (self.treeview, n, self.names[n], self.typs[n])
+ create_cell (self.treeview, n, self.names[n], self.typs[n])
stock_items = invest.STOCKS.items ()
stock_items.sort ()
for key, purchases in stock_items:
@@ -66,9 +66,9 @@ class PrefsDialog:
self.dialog.set_icon(pixbuf)
except Exception, msg:
pass
-
+
self.sync_ui()
-
+
def show_run_hide(self, explanation = ""):
expl = self.ui.get_object("explanation")
expl.set_markup(explanation)
@@ -77,16 +77,16 @@ class PrefsDialog:
expl.hide()
self.dialog.run()
self.dialog.destroy()
-
+
invest.STOCKS = {}
-
+
def save_symbol(model, path, iter):
#if int(model[iter][1]) == 0 or float(model[iter][2]) < 0.0001:
# return
-
+
if not model[iter][0] in invest.STOCKS:
invest.STOCKS[model[iter][0]] = []
-
+
invest.STOCKS[model[iter][0]].append({
"amount": float(model[iter][1]),
"bought": float(model[iter][2]),
@@ -98,24 +98,24 @@ class PrefsDialog:
if invest.DEBUGGING: print 'Stocks written to file'
except Exception, msg:
if invest.DEBUGGING: print 'Could not save stocks file:', msg
-
-
+
+
def sync_ui(self):
pass
-
+
def on_add_stock(self, w):
self.treeview.get_model().append(["GOOG", 0, 0, 0])
-
+
def on_remove_stock(self, w):
model, paths = self.treeview.get_selection().get_selected_rows()
for path in paths:
model.remove(model.get_iter(path))
-
+
def on_tree_keypress(self, w, event):
if event.keyval == 65535:
- self.on_remove_stock(self, w)
-
+ self.on_remove_stock(w)
+
return False
-
+
def show_preferences(applet, explanation = ""):
PrefsDialog(applet).show_run_hide(explanation)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]