[billreminder/fresh] Added newer bills to get more data for visualizing how the billtree widgets looks.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder/fresh] Added newer bills to get more data for visualizing how the billtree widgets looks.
- Date: Sat, 16 Jan 2010 18:29:26 +0000 (UTC)
commit 9a700ddcafe3b21ec4a7c3685b13573fc5e72a8a
Author: Og B. Maciel <ogmaciel gnome org>
Date: Sat Jan 16 13:26:11 2010 -0500
Added newer bills to get more data for visualizing how the billtree widgets looks.
src/gui/new.py | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/new.py b/src/gui/new.py
index e04d0a6..27beeac 100755
--- a/src/gui/new.py
+++ b/src/gui/new.py
@@ -8,6 +8,10 @@ import widgets
import datetime as dt
+TODAY = dt.date.today()
+NEXT_WEEK = TODAY + dt.timedelta(days=7)
+LAST_WEEK = TODAY - dt.timedelta(days=7)
+
class MainWindow:
def __init__(self):
# Create a new window
@@ -15,22 +19,32 @@ class MainWindow:
self.window = self.ui.get_object("main_window")
self.upcoming = widgets.BillTree()
- self.ui.get_object("upcoming_box").add(self.upcoming)
+ self.ui.get_object("bill_box").add(self.upcoming)
self.window.show_all()
self.ui.connect_signals(self)
-
+
self.load_bills()
def load_bills(self):
self.upcoming.clear()
- ht = entities.Bill('Harris Teeter', 123.94, dt.date.today())
- food = entities.Category('Groceries')
+ ht = entities.Bill('Harris Teeter', 123.94, TODAY)
+ food = entities.Category('Groceries', '#ad7fa8')
ht.category = food
+ aes = entities.Bill('Alan & Sons', 41.65, NEXT_WEEK)
+ dining = entities.Category('Dining', '#fce94f')
+ aes.category = dining
+
+ energy = entities.Bill('Duke Energy', 62, LAST_WEEK)
+ utilities = entities.Category('Utilities', '#73d216')
+ energy.category = utilities
+
self.upcoming.add_bill(ht)
-
+ self.upcoming.add_bill(aes)
+ self.upcoming.add_bill(energy)
+
# close the window and quit
def on_delete_event(self, widget, event, data=None):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]