comparison getan.py @ 42:a5439795ef09

More checks againts empty projects.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 15 Dec 2010 12:02:55 +0100
parents f44f808e7d47
children 780bfda9c583 1d63ab21b8af
comparison
equal deleted inserted replaced
41:f44f808e7d47 42:a5439795ef09
52 else: 52 else:
53 self.state = self.state.keypress(input) 53 self.state = self.state.keypress(input)
54 54
55 def update_entries(self, project): 55 def update_entries(self, project):
56 logger.debug("GetanController: update entries.") 56 logger.debug("GetanController: update entries.")
57 self.entries_view.set_rows(self.backend.load_entries(project.id)) 57 if project: entries = self.backend.load_entries(project.id)
58 else: entries = []
59 self.entries_view.set_rows(entries)
58 self.view.update_view() 60 self.view.update_view()
59 61
60 def move_selected_entries(self, project): 62 def move_selected_entries(self, project):
61 old_project = None 63 old_project = None
62 entries = [] 64 entries = []
129 % (project.desc, format_time(datetime.now()))) 131 % (project.desc, format_time(datetime.now())))
130 self.view.set_footer_text(" Running on '%s'" % project.desc, 'running') 132 self.view.set_footer_text(" Running on '%s'" % project.desc, 'running')
131 logger.debug('All running projects: %r' % self.running) 133 logger.debug('All running projects: %r' % self.running)
132 134
133 def stop_project(self, desc='-no description-'): 135 def stop_project(self, desc='-no description-'):
136 if not self.running: return
134 project = self.running.pop() 137 project = self.running.pop()
135 if not project: return 138 if not project: return
136 logger.info("Stop project '%s' at %s." 139 logger.info("Stop project '%s' at %s."
137 % (project.desc, format_time(datetime.now()))) 140 % (project.desc, format_time(datetime.now())))
138 project.stop = datetime.now() 141 project.stop = datetime.now()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)