From 274867ca678df87a3b261e4473e08cb1e851f256 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sat, 29 Jul 2017 14:30:40 +0100 Subject: [PATCH] url parameter no longer mandatory for HyperlinkLabel --- plugins/edsm.py | 2 +- ttkHyperlinkLabel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index a38be968..a3900232 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -64,7 +64,7 @@ def plugin_start(): def plugin_app(parent): this.system_label = tk.Label(parent, text = _('System') + ':') # Main window - this.system = HyperlinkLabel(parent, compound=tk.RIGHT, url = None, popup_copy = True) + this.system = HyperlinkLabel(parent, compound=tk.RIGHT, popup_copy = True) return (this.system_label, this.system) def plugin_prefs(parent, cmdr, is_beta): diff --git a/ttkHyperlinkLabel.py b/ttkHyperlinkLabel.py index 734d44c9..73f1a9e4 100644 --- a/ttkHyperlinkLabel.py +++ b/ttkHyperlinkLabel.py @@ -43,7 +43,7 @@ if platform == 'win32': class HyperlinkLabel(platform == 'darwin' and tk.Label or ttk.Label, object): def __init__(self, master=None, **kw): - self.url = kw.pop('url') + self.url = 'url' in kw and kw.pop('url') or None self.popup_copy = kw.pop('popup_copy', False) self.underline = kw.pop('underline', None) # override ttk.Label's underline self.foreground = kw.get('foreground') or 'blue'