diff options
author | emkael <emkael@tlen.pl> | 2019-05-29 22:40:39 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-05-29 22:40:39 +0200 |
commit | 54bb72f6ee338f53ad34b04eb6ede6c04224b093 (patch) | |
tree | c25e24ddbec3cc0be2c03cb0a2db7ac501c69e48 /jfr_playoff | |
parent | 25965dde4bdd35240290f7b3d7d59141b6160093 (diff) |
Team alias and ties config
Diffstat (limited to 'jfr_playoff')
-rw-r--r-- | jfr_playoff/gui/frames/team.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/jfr_playoff/gui/frames/team.py b/jfr_playoff/gui/frames/team.py index b7ecf0a..4418bb2 100644 --- a/jfr_playoff/gui/frames/team.py +++ b/jfr_playoff/gui/frames/team.py @@ -228,6 +228,11 @@ class TeamAliasRow(RepeatableFrame): self.names = WidgetRepeater(self, RepeatableEntry) self.names.grid(row=0, column=1, sticky=tk.W+tk.E) + def getValue(self): + return ( + self.teamName.get().strip(), + [val.strip() for val in self.names.getValue()]) + class TeamAliasFrame(tk.Frame): def __init__(self, *args, **kwags): tk.Frame.__init__(self, *args, **kwags) @@ -240,6 +245,9 @@ class TeamAliasFrame(tk.Frame): self.repeater = WidgetRepeater(self, TeamAliasRow) self.repeater.grid(row=1, column=0, sticky=tk.W+tk.E) + def getConfig(self): + return {val[0]: val[1] for val in self.repeater.getValue() if val[0]} + class TeamPreviewFrame(tk.Frame): def __init__(self, *args, **kwags): tk.Frame.__init__(self, *args, **kwags) @@ -293,4 +301,10 @@ class TeamPreviewFrame(tk.Frame): self.setTeams([]) + def getTieConfig(self): + ties = [getIntVal(val, 0) for val in self.tieValues] + if len(ties) and max(ties) == 0: + return None + return ties + __all__ = ['TeamSettingsFrame', 'TeamAliasFrame', 'TeamPreviewFrame'] |