[Getan-commits] [PATCH] Add a redraw function on key Control-L

Wald Commits scm-commit at wald.intevation.org
Wed May 16 17:07:05 CEST 2018


# HG changeset patch
# User Magnus Schieder <mschieder at intevation.de>
# Date 1526482957 -7200
# Node ID 75131561d098a468c0c39e57667cededa773a01e
# Parent  950bfe89ec3da63d4cbf77e2495d2e79a78a266e
Add a redraw function on key Control-L.

diff -r 950bfe89ec3d -r 75131561d098 CHANGES
--- a/CHANGES	Fri May 11 14:27:48 2018 +0200
+++ b/CHANGES	Wed May 16 17:02:37 2018 +0200
@@ -1,5 +1,10 @@
 2.x 20xx-xx-xx UNRELEASED
 
+ * Add a redraw function on key Control-L.
+   The screen is completely redrawn. More information can be found in
+   ./doc/old_issues.txt -20180321 BER
+
+
  * Better fix for the multiple selection bug.
    The multiple selection is deleted when deleting or moving is confirmed or
    when switching to projects.
diff -r 950bfe89ec3d -r 75131561d098 INTRODUCTION
--- a/INTRODUCTION	Fri May 11 14:27:48 2018 +0200
+++ b/INTRODUCTION	Wed May 16 17:02:37 2018 +0200
@@ -30,3 +30,4 @@
                        running).
 | backspace         |  Change key and description of a Project (in ProjectList
                        if no project is running).
+| Control-L         |  Completely redraw the screen.
diff -r 950bfe89ec3d -r 75131561d098 TODO
--- a/TODO	Fri May 11 14:27:48 2018 +0200
+++ b/TODO	Wed May 16 17:02:37 2018 +0200
@@ -1,8 +1,3 @@
-20180321 BER Add a redraw function/key, usually Control-L is used.
-    If the screen gets disorted, e.g. by a background process spilling
-    some stuff on stderror, you want a completely redrawn screen without
-    restarting getan.
-
 20180117 Magnus Schieder
 
   Creating a new database with test data:
diff -r 950bfe89ec3d -r 75131561d098 doc/old_issues.txt
--- a/doc/old_issues.txt	Fri May 11 14:27:48 2018 +0200
+++ b/doc/old_issues.txt	Wed May 16 17:02:37 2018 +0200
@@ -1,3 +1,8 @@
+20180321 BER Add a redraw function/key, usually Control-L is used.
+    If the screen gets disorted, e.g. by a background process spilling
+    some stuff on stderror, you want a completely redrawn screen without
+    restarting getan.
+
 20180214 Magnus Schieder
   Reproduced with getan2.1 and getan2.3dev1
 
diff -r 950bfe89ec3d -r 75131561d098 getan/controller.py
--- a/getan/controller.py	Fri May 11 14:27:48 2018 +0200
+++ b/getan/controller.py	Wed May 16 17:02:37 2018 +0200
@@ -47,6 +47,12 @@
                                    input_filter=self.input_filter)
         self.loop.run()
 
+    def redraw(self):
+        self.loop.stop()
+        self.loop.start()
+        self.loop.screen_size = None
+        self.loop.draw_screen()
+
     def input_filter(self, input, raw_input):
         if 'window resize' in input:
             self.loop.screen_size = None
diff -r 950bfe89ec3d -r 75131561d098 getan/states.py
--- a/getan/states.py	Fri May 11 14:27:48 2018 +0200
+++ b/getan/states.py	Wed May 16 17:02:37 2018 +0200
@@ -83,6 +83,10 @@
             self.view.switch_project_order()
             return True
 
+        if 'ctrl l' in input:
+            self.controller.redraw()
+            return True
+
         if keys.get_switch_lists() in input:
             if not self.controller.entries_view.rows:
                 return True
@@ -183,6 +187,10 @@
                 PausedProjectsState(self.controller, self.view))
             return True
 
+        if 'ctrl l' in key:
+            self.controller.redraw()
+            return True
+
         if 'backspace' in key:
             if len(self.proj_keys) > 0:
                 self.proj_keys = self.proj_keys[:-1]
@@ -482,6 +490,10 @@
             self.controller.view.set_focus(0)
             return True
 
+        if 'ctrl l' in key:
+            self.controller.redraw()
+            return True
+
         if keys.get_enter() in key:
             return self.select()
         return False


More information about the Getan-commits mailing list