Skip to content

Commit

Permalink
Fix ETT only partially set when passed on command line
Browse files Browse the repository at this point in the history
  • Loading branch information
Cimbali committed Dec 20, 2017
1 parent 2738811 commit 2242582
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pympress/editable_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand All @@ -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/
"""
Expand Down

0 comments on commit 2242582

Please sign in to comment.