From df5e573b7ce81d2eb52a70bb995bc36ffa52d8a5 Mon Sep 17 00:00:00 2001 From: Lukáš Růžička Date: Jul 30 2020 14:09:01 +0000 Subject: Fix the template and the translator to enable stop key screenshot. --- diff --git a/templates/page.adoc b/templates/page.adoc index 61b8a62..93daf13 100644 --- a/templates/page.adoc +++ b/templates/page.adoc @@ -63,7 +63,7 @@ image::{{event.screens[1]}}[] {% elif event.type == "key" and event.subtype == "stop" and event.action == "press" %} . This is the end of the recording. See the screenshot that shows the situation at the end of the recording. + -image::{{event.screens[1]}}[] +image::{{event.screens[0]}}[] {% endif %} {% endfor %} diff --git a/translator.py b/translator.py index 2102c00..7a8d550 100644 --- a/translator.py +++ b/translator.py @@ -125,7 +125,7 @@ class Translator: except KeyError: combo = None return combo - + def polish_data(self, lang): """ Iterate over the json data and polish them for output. @@ -230,6 +230,12 @@ class Translator: regular, corrected = screens self.draw_needle_area(area, corrected, self.stepname_file(numbering), lang) data['screens'] = [regular, self.stepname_file(numbering)] + elif data['subtype'] == "stop": + # To make sure the stop_key screenshot gets a proper name, too + area = self.create_needle_area(None) + regular, corrected = screens + self.draw_needle_area(area, regular, "final.png", lang) + data['screens'] = ["final.png", corrected] else: # This should never happen. line = f"""{numbering}. Do something with the keyboard, but I am not sure what. """