Exemple #1
0
 def on_cursor_changed(self, treeview):
     """Move to the selected day when user clicks on it"""
     model, paths = self.get_selection().get_selected_rows()
     if not paths:
         return
     date_string = self.tree_store[paths[0]][0]
     new_date = dates.get_date_from_date_string(date_string)
     self.journal.change_date(new_date)
Exemple #2
0
 def on_cursor_changed(self, treeview):
     """Move to the selected day when user clicks on it"""
     model, paths = self.get_selection().get_selected_rows()
     if not paths:
         return
     date_string = self.tree_store[paths[0]][0]
     new_date = dates.get_date_from_date_string(date_string)
     self.journal.change_date(new_date)
Exemple #3
0
    def get_start_date(self):
        '''
        Retrieve the date from optional args or otherwise return 'today'
        '''
        if not args.start_date:
            return datetime.date.today()

        try:
            return dates.get_date_from_date_string(args.start_date)
        except ValueError:
            logging.error('Invalid date: %s (required format: YYYY-MM-DD).' % args.start_date)
            sys.exit(2)
Exemple #4
0
    def on_cursor_changed(self, treeview):
        """Move to the selected day when user clicks on it"""
        selection = self.tree_view.get_selection()
        model, paths = selection.get_selected_rows()
        if not paths:
            return
        date_string = self.tree_store[paths[0]][0]
        new_date = dates.get_date_from_date_string(date_string)
        self.journal.change_date(new_date)

        if self.search_type == 0:
            self.main_window.highlight_text(self.searched_text)
Exemple #5
0
 def navigate_to_referenced_entry(self, entry_reference_uri):
     entry_reference_uri = urllib.parse.urlparse(entry_reference_uri)
     date = dates.get_date_from_date_string(entry_reference_uri.fragment)
     self.journal.change_date(date)