~rick-rickspencer3/daily-journal/quickly_trunk

« back to all changes in this revision

Viewing changes to bin/daily-journal

  • Committer: Rick Spencer
  • Date: 2010-09-23 14:25:09 UTC
  • mfrom: (60.1.1 no_empty)
  • Revision ID: rick.spencer@canonical.com-20100923142509-1wkuji6uwn8lx316
merging in laserjock's improvement to delete empty entries on save

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        """Called when the DailyJournalWindow is closed."""
277
277
        # Clean up code for saving application state should be added here.
278
278
        self.save()
 
279
 
 
280
        db = CouchDatabase("daily_journal")
 
281
        record_type = "http://wiki.ubuntu.com/Quickly/RecordTypes/DailyJournal"
 
282
        results = db.get_records(record_type = record_type, create_view = True)
 
283
        for records in results:
 
284
            record = records.value
 
285
            if record["Text"] == "":
 
286
                db.delete_record(record["_id"])
 
287
 
279
288
        gtk.main_quit()
280
289
 
281
290
if __name__ == "__main__":