[billreminder] Adding support for Alarms.



commit b79402a8e9f87850d020427d66d0ce05287f5213
Author: Og B. Maciel <ogmaciel gnome org>
Date:   Sun Dec 20 15:07:48 2009 -0500

    Adding support for Alarms.

 src/db/entities.py   |    7 +++++--
 src/lib/scheduler.py |    3 ---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/db/entities.py b/src/db/entities.py
index 204e817..3d938d3 100644
--- a/src/db/entities.py
+++ b/src/db/entities.py
@@ -1,4 +1,4 @@
-from sqlalchemy import Column, Integer, String, Numeric, Text, Date, Boolean, ForeignKey
+from sqlalchemy import Column, Integer, String, Numeric, Text, Date, DateTime, Boolean, ForeignKey
 from sqlalchemy.orm import relation, backref
 from sqlalchemy.ext.declarative import declarative_base
 
@@ -26,6 +26,7 @@ class Bill(Base):
     payee = Column(String(length=255, convert_unicode=True))
     amount = Column(Numeric)
     dueDate = Column(Date)
+    alarmDate = Column(DateTime)
     notes = Column(Text(convert_unicode=True))
     paid = Column(Boolean)
     repeats = Column(Boolean)
@@ -33,10 +34,12 @@ class Bill(Base):
     catId = Column(Integer, ForeignKey('categories.id'))
     category = relation(Category, backref=backref('bills', order_by=id))
 
-    def __init__(self, payee, amount, dueDate, notes=None, paid=False, repeats=False):
+    def __init__(self, payee, amount, dueDate, alarmDate=None, notes=None, paid=False, repeats=False):
         self.payee = payee
         self.amount=amount
         self.dueDate = dueDate
+        if alarmDate:
+            self.alarmDate = alarmDate
         if notes:
             self.notes = notes
         self.paid = paid
diff --git a/src/lib/scheduler.py b/src/lib/scheduler.py
index d281f80..395f232 100644
--- a/src/lib/scheduler.py
+++ b/src/lib/scheduler.py
@@ -98,9 +98,6 @@ def get_alarm_timestamp(alertDays, alertTime, origDate):
 
     ret = datetime.datetime(alertDate.year, alertDate.month, alertDate.day, int(alertTime[0]), int(alertTime[1]))
 
-    # Convert to timestamp
-    ret = timestamp_from_datetime(ret)
-
     return ret
 
 if __name__ == "__main__":



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]