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
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
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)
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
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)
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)
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
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)
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)
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)
def _send_tray_hints(self): self.iface.set_tray_hints(force_string(self.notify.get_hints())) timeout_add(60000, self._send_tray_hints)
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
def _send_tray_hints(self): self.iface.set_tray_hints(force_string(self.notify.get_hints())) gobject.timeout_add(60000, self._send_tray_hints)