Beispiel #1
0
 def get_bills(self, kwargs):
     """ Returns one or more records that meet the criteria passed """
     ret = []
     records = self.actions.get_bills(kwargs)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #2
0
 def get_categories_(self, kwargs):
     """ Returns one or more records that meet the criteria passed """
     ret = []
     records = self.actions.get_categories(kwargs)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #3
0
 def delete(self, kwargs):
     """ Delete a record in the database """
     try:
         return self.dbus_interface.delete(force_string(props(kwargs)))
     except dbus.DBusException:
         if self.__init__():
             return self.delete(kwargs)
Beispiel #4
0
 def delete(self, kwargs):
     """ Delete a record in the database """
     try:
         return self.dbus_interface.delete(force_string(props(kwargs)))
     except dbus.DBusException:
         if self.__init__():
             return self.delete(kwargs)
Beispiel #5
0
 def get_alarm_bills(self, start, end, paid):
     ret = []
     records = self.actions.get_alarm_bills(date.fromordinal(start),
                                            date.fromordinal(end), paid)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #6
0
 def edit(self, kwargs):
     """ Edit a record in the database """
     try:
         record = self.dbus_interface.edit(force_string(kwargs.__dict__))
         return self._correct_type(record)
     except dbus.DBusException:
         if self.__init__():
             return self.edit(kwargs)
Beispiel #7
0
 def add(self, kwargs):
     """ Adds a bill to the database """
     try:
         record = self.dbus_interface.add(force_string(kwargs.__dict__))
         return self._correct_type(record)
     except dbus.DBusException:
         if self.__init__():
             return self.add(kwargs)
Beispiel #8
0
 def add(self, kwargs):
     """ Adds a bill to the database """
     try:
         record = self.dbus_interface.add(force_string(kwargs.__dict__))
         return self._correct_type(record)
     except dbus.DBusException:
         if self.__init__():
             return self.add(kwargs)
Beispiel #9
0
 def edit(self, kwargs):
     """ Edit a record in the database """
     try:
         record = self.dbus_interface.edit(force_string(kwargs.__dict__))
         return self._correct_type(record)
     except dbus.DBusException:
         if self.__init__():
             return self.edit(kwargs)
Beispiel #10
0
 def get_categories(self, kwargs):
     """ Returns one or more records that meet the criteria passed """
     print 'get_categories'
     ret = []
     records = self.actions.get_categories(**kwargs)
     print records
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #11
0
 def get_bills(self, **kwargs):
     """ Returns one or more records that meet the criteria passed """
     try:
         ret = []
         if isinstance(kwargs, basestring):
             records = self.dbus_interface.get_bills_(**kwargs)
         else:
             records = self.dbus_interface.get_bills(force_string(kwargs))
         for record in records:
             record = self._correct_type(record)
             ret.append(record)
         return ret
     except dbus.DBusException:
         if self.__init__():
             return self.get_bills(**kwargs)
Beispiel #12
0
 def get_bills(self, **kwargs):
     """ Returns one or more records that meet the criteria passed """
     try:
         ret = []
         if isinstance(kwargs, basestring):
             records = self.dbus_interface.get_bills_(**kwargs)
         else:
             records = self.dbus_interface.get_bills(force_string(kwargs))
         for record in records:
             record = self._correct_type(record)
             ret.append(record)
         return ret
     except dbus.DBusException:
         if self.__init__():
             return self.get_bills(**kwargs)
Beispiel #13
0
 def add(self, kwargs):
     """ Add a record to the database """
     ret = self.actions.add(kwargs)
     if ret:
         self.bill_added(kwargs)
     return force_string(ret)
Beispiel #14
0
 def edit(self, kwargs):
     """ Edit a record in the database """
     ret = self.actions.edit(kwargs)
     if ret:
         self.bill_edited(ret)
     return force_string(ret)
Beispiel #15
0
 def _send_tray_hints(self):
     self.iface.set_tray_hints(force_string(self.notify.get_hints()))
     timeout_add(60000, self._send_tray_hints)
Beispiel #16
0
 def get_monthly_bills(self, month, year, paid):
     ret = []
     records = self.actions.get_interval_bills(month, year, paid)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #17
0
 def get_alarm_bills(self, start, end, paid):
     ret = []
     records = self.actions.get_alarm_bills(date.fromordinal(start), date.fromordinal(end), paid)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #18
0
 def add(self, kwargs):
     """ Add a record to the database """
     ret = self.actions.add(kwargs)
     if ret:
         self.bill_added(kwargs)
     return force_string(ret)
Beispiel #19
0
 def get_monthly_bills(self, month, year, paid):
     ret = []
     records = self.actions.get_interval_bills(month, year, paid)
     for record in records:
         ret.append(force_string(record))
     return ret
Beispiel #20
0
 def _send_tray_hints(self):
     self.iface.set_tray_hints(force_string(self.notify.get_hints()))
     gobject.timeout_add(60000, self._send_tray_hints)
Beispiel #21
0
 def edit(self, kwargs):
     """ Edit a record in the database """
     ret = self.actions.edit(kwargs)
     if ret:
         self.bill_edited(ret)
     return force_string(ret)