diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-07-03 19:11:07 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-07-03 19:11:07 (GMT) |
commit | 84a37cd49994245fda88f309f1d3adfa926569c3 (patch) | |
tree | 177bb2b8d14934079e309ce9e30c6a11b86a72d8 | |
parent | e6f9911735853d0ec4e5acfc178b3bcce83a1ab1 (diff) |
Pep8 fixes
-rw-r--r-- | budgetscreen.py | 23 | ||||
-rw-r--r-- | finance.py | 4 | ||||
-rw-r--r-- | helpbutton.py | 3 |
3 files changed, 16 insertions, 14 deletions
diff --git a/budgetscreen.py b/budgetscreen.py index 24eadbe..d1863a7 100644 --- a/budgetscreen.py +++ b/budgetscreen.py @@ -61,7 +61,7 @@ class BudgetScreen(Gtk.VBox): amount = t['amount'] if t['type'] == 'debit': - if not cat in self.category_total: + if cat not in self.category_total: self.category_total[cat] = amount else: self.category_total[cat] += amount @@ -127,18 +127,18 @@ class BudgetScreen(Gtk.VBox): budgetentry.set_text(locale.currency(b['amount'], False)) budgetgroup.add_widget(budgetentry) - #freqcombo = Gtk.ComboBoxText() - #freqcombo.append_text(_('Daily')) - #freqcombo.append_text(_('Weekly')) - #freqcombo.append_text(_('Monthly')) - #freqcombo.append_text(_('Annually')) - #freqcombo.set_active(2) + # freqcombo = Gtk.ComboBoxText() + # freqcombo.append_text(_('Daily')) + # freqcombo.append_text(_('Weekly')) + # freqcombo.append_text(_('Monthly')) + # freqcombo.append_text(_('Annually')) + # freqcombo.set_active(2) hbox = Gtk.HBox() hbox.pack_start(ebox, False, False, 20) hbox.pack_start(bar, True, True, 10) hbox.pack_start(budgetentry, False, False, 20) - #hbox.pack_start(freqcombo, True, True, 0) + # hbox.pack_start(freqcombo, True, True, 0) self.budgetbox.pack_start(hbox, False, False, 5) @@ -152,8 +152,9 @@ class BudgetScreen(Gtk.VBox): if self.activity.period != _('Day') and \ self.activity.period != _('Forever'): period_length = ( - self.activity.get_next_period(self.activity.period_start) - \ - self.activity.period_start).days + self.activity.get_next_period( + self.activity.period_start) - + self.activity.period_start).days period_ratio = float( (datetime.date.today() - self.activity.period_start).days) / \ period_length @@ -195,7 +196,7 @@ class BudgetScreen(Gtk.VBox): if ratio > 1.0: cr.set_source_rgb(1.0, 0.6, 0.6) - elif period_ratio != None and ratio > period_ratio: + elif period_ratio is not None and ratio > period_ratio: cr.set_source_rgb(0.9, 0.9, 0.6) else: cr.set_source_rgb(0.6, 1.0, 0.6) @@ -1,3 +1,4 @@ +#!/usr/bin/env python # Copyright 2008 by Wade Brainerd. # This file is part of Finance. # @@ -13,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with Finance. If not, see <http://www.gnu.org/licenses/>. -#!/usr/bin/env python """Finance - Home financial software for the OLPC XO.""" @@ -128,7 +128,7 @@ class Finance(Activity): self.transaction_names = {} self.category_names = {} - #self.create_test_data() + # self.create_test_data() # Initialize view period to the first of the month. self.period = _('Month') diff --git a/helpbutton.py b/helpbutton.py index a9561db..5153de1 100644 --- a/helpbutton.py +++ b/helpbutton.py @@ -41,7 +41,8 @@ class HelpButton(Gtk.ToolItem): self._palette = help_button.get_palette() sw = Gtk.ScrolledWindow() - sw.set_size_request(int(Gdk.Screen.width() / 2.8), + sw.set_size_request( + int(Gdk.Screen.width() / 2.8), Gdk.Screen.height() - style.GRID_CELL_SIZE * 3) sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) |