summaryrefslogtreecommitdiff
path: root/invest-applet/invest/preferences.py
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-01-27 14:37:19 +0100
committerStefano Karapetsas <[email protected]>2012-01-27 14:37:19 +0100
commitbf8f363ef056cee972185e18b3793b5d5551a1a3 (patch)
tree9cbfb5bd6b4ea3b81220c1a66598c5f2d7851523 /invest-applet/invest/preferences.py
parentc7b2e180e6cfb4aec22f8ab3e0aebc6773032216 (diff)
downloadmate-applets-bf8f363ef056cee972185e18b3793b5d5551a1a3.tar.bz2
mate-applets-bf8f363ef056cee972185e18b3793b5d5551a1a3.tar.xz
'mate-invest' => 'mate_invest'
Diffstat (limited to 'invest-applet/invest/preferences.py')
-rw-r--r--invest-applet/invest/preferences.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/invest-applet/invest/preferences.py b/invest-applet/invest/preferences.py
index 14bc6f90..03a9147f 100644
--- a/invest-applet/invest/preferences.py
+++ b/invest-applet/invest/preferences.py
@@ -2,14 +2,14 @@ from gettext import gettext as _
import locale
from os.path import join
import gtk, gobject, mateconf
-import mate-invest
+import mate_invest
import currencies
import cPickle
class PrefsDialog:
def __init__(self, applet):
self.ui = gtk.Builder()
- self.ui.add_from_file(join(mate-invest.BUILDER_DATA_DIR, "prefs-dialog.ui"))
+ self.ui.add_from_file(join(mate_invest.BUILDER_DATA_DIR, "prefs-dialog.ui"))
self.dialog = self.ui.get_object("preferences")
self.treeview = self.ui.get_object("stocks")
@@ -44,8 +44,8 @@ class PrefsDialog:
completion.set_match_func(self.match_func, 0)
completion.connect("match-selected", self.on_completion_selection, 1)
- if mate-invest.CONFIG.has_key("currency"):
- code = mate-invest.CONFIG["currency"];
+ if mate_invest.CONFIG.has_key("currency"):
+ code = mate_invest.CONFIG["currency"];
if self.currencies.has_key(code):
self.currency_code = code;
currency = self.format_currency(self.currencies[self.currency_code], self.currency_code)
@@ -56,7 +56,7 @@ class PrefsDialog:
if self.currency_code != None:
self.add_exchange_column()
- stock_items = mate-invest.STOCKS.items ()
+ stock_items = mate_invest.STOCKS.items ()
stock_items.sort ()
for key, data in stock_items:
label = data["label"]
@@ -80,7 +80,7 @@ class PrefsDialog:
value = locale.atof(new_text)
self.model[path][col] = value
except Exception, msg:
- mate-invest.error('Exception while processing cell change: %s' % msg)
+ mate_invest.error('Exception while processing cell change: %s' % msg)
pass
def format(self, fmt, value):
@@ -138,16 +138,16 @@ class PrefsDialog:
pass
self.dialog.destroy()
- mate-invest.STOCKS = {}
+ mate_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 mate-invest.STOCKS:
- mate-invest.STOCKS[model[iter][0]] = { 'label': model[iter][1], 'purchases': [] }
+ if not model[iter][0] in mate_invest.STOCKS:
+ mate_invest.STOCKS[model[iter][0]] = { 'label': model[iter][1], 'purchases': [] }
- mate-invest.STOCKS[model[iter][0]]["purchases"].append({
+ mate_invest.STOCKS[model[iter][0]]["purchases"].append({
"amount": float(model[iter][2]),
"bought": float(model[iter][3]),
"comission": float(model[iter][4]),
@@ -155,19 +155,19 @@ class PrefsDialog:
})
self.model.foreach(save_symbol)
try:
- cPickle.dump(mate-invest.STOCKS, file(mate-invest.STOCKS_FILE, 'w'))
- mate-invest.debug('Stocks written to file')
+ cPickle.dump(mate_invest.STOCKS, file(mate_invest.STOCKS_FILE, 'w'))
+ mate_invest.debug('Stocks written to file')
except Exception, msg:
- mate-invest.error('Could not save stocks file: %s' % msg)
+ mate_invest.error('Could not save stocks file: %s' % msg)
- mate-invest.CONFIG = {}
+ mate_invest.CONFIG = {}
if self.currency_code != None and len(self.currency_code) == 3:
- mate-invest.CONFIG['currency'] = self.currency_code
+ mate_invest.CONFIG['currency'] = self.currency_code
try:
- cPickle.dump(invest.CONFIG, file(mate-invest.CONFIG_FILE, 'w'))
- mate-invest.debug('Configuration written to file')
+ cPickle.dump(invest.CONFIG, file(mate_invest.CONFIG_FILE, 'w'))
+ mate_invest.debug('Configuration written to file')
except Exception, msg:
- mate-invest.debug('Could not save configuration file: %s' % msg)
+ mate_invest.debug('Could not save configuration file: %s' % msg)
def sync_ui(self):
pass
@@ -183,7 +183,7 @@ class PrefsDialog:
model.remove(model.get_iter(path))
def on_help(self, w):
- mate-invest.help.show_help_section("invest-applet-usage")
+ mate_invest.help.show_help_section("invest-applet-usage")
def on_tree_keypress(self, w, event):
if event.keyval == 65535: