Mercurial > getan > getan
comparison getan/states.py @ 530:93e740bc730f
Clean up the source code
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Tue, 11 Jun 2019 13:11:00 +0200 |
parents | 210bd796829e |
children | 5ec211c172ed |
comparison
equal
deleted
inserted
replaced
529:9d27713164c9 | 530:93e740bc730f |
---|---|
453 super(DescriptionProjectsState, self).__init__(controller, view, state, | 453 super(DescriptionProjectsState, self).__init__(controller, view, state, |
454 footer) | 454 footer) |
455 self.project = project | 455 self.project = project |
456 self.history_position = - 1 | 456 self.history_position = - 1 |
457 | 457 |
458 | |
458 def keypress(self, size, key): | 459 def keypress(self, size, key): |
459 """ Direct key to frame of GetanView """ | 460 """ Direct key to frame of GetanView """ |
460 | 461 |
461 self.controller.view.frame.keypress(size, key) | 462 self.controller.view.frame.keypress(size, key) |
462 | 463 |
463 entries = self.project.backend.load_entries(self.project.id) | 464 entries = self.project.entries |
464 if key == 'up': | 465 if key == 'up': |
465 if self.history_position < len(entries) - 1: | 466 if self.history_position < len(entries) - 1: |
466 self.history_position = self.history_position + 1 | 467 self.history_position = self.history_position + 1 |
467 self.controller.view.frame.footer.set_edit_text( | 468 self.controller.view.frame.footer.set_edit_text( |
468 entries[self.history_position].desc) | 469 entries[self.history_position].desc) |
478 else: | 479 else: |
479 self.controller.view.frame.footer.set_edit_text( | 480 self.controller.view.frame.footer.set_edit_text( |
480 entries[self.history_position].desc) | 481 entries[self.history_position].desc) |
481 self.controller.view.frame.footer.set_edit_pos( | 482 self.controller.view.frame.footer.set_edit_pos( |
482 len(entries[self.history_position].desc)) | 483 len(entries[self.history_position].desc)) |
483 | |
484 | 484 |
485 | 485 |
486 def enter(self): | 486 def enter(self): |
487 text = self.footer.get_edit_text() | 487 text = self.footer.get_edit_text() |
488 self.controller.stop_project(text) | 488 self.controller.stop_project(text) |