From 22425820b5a70177d0b40548a8ff95abad299b18 Mon Sep 17 00:00:00 2001 From: Cimbali Date: Wed, 20 Dec 2017 12:04:34 +0100 Subject: [PATCH] Fix ETT only partially set when passed on command line --- pympress/editable_label.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pympress/editable_label.py b/pympress/editable_label.py index 58defd63..59af31ca 100644 --- a/pympress/editable_label.py +++ b/pympress/editable_label.py @@ -321,7 +321,7 @@ class EstimatedTalkTime(EditableLabel): stop_editing_page_number = lambda: None - def __init__(self, builder, ett): + def __init__(self, builder, ett = 0): """ Setup the talk time. Args: @@ -332,11 +332,13 @@ def __init__(self, builder, ett): builder.load_widgets(self) + self.est_time = ett self.label_ett.set_text("{:02}:{:02}".format(*divmod(ett, 60))) self.shortcut_key = 'T' self.event_box = self.eb_ett + def delayed_callback_connection(self, builder): """ Connect callbacks later than at init, due to circular dependencies. Call this when the page_number module is initialized, but before needing the callback. @@ -346,6 +348,7 @@ def delayed_callback_connection(self, builder): """ self.stop_editing_page_number = builder.get_callback_handler('page_number.stop_editing') + def validate(self): """ Update estimated talk time from the input/ """