Fix tooltip on Arguments for TestRunner plugin. Now shows error message.
@@ -259,9 +259,9 @@ class PybotProfile(BaseProfile):
self._arguments.SetForegroundColour(
'white' if invalid_message else 'black')
# DEBUG wxPhoenix self._arguments.SetToolTipString
- self.MySetToolTip(self._arguments,
- invalid_message or
- 'Arguments for the test run. Arguments are space separated list.')
+ if not bool(invalid_message):
+ invalid_message = 'Arguments for the test run. Arguments are space separated list.'
+ self.MySetToolTip(self._arguments, invalid_message)
def MySetToolTip(self, obj, tip):
if wx.VERSION >= (3, 0, 3, ''): # DEBUG wxPhoenix
@@ -270,18 +270,19 @@ class PybotProfile(BaseProfile):
obj.SetToolTipString(tip)
def _get_invalid_message(self, args):
+ invalid = None
try:
# print("DEBUG: runprofiles get inv msg: %s\nraw: %s\n" % (bytes(args), args) )
if PY3:
args = args.encode(SYSTEM_ENCODING) # DEBUG SYSTEM_ENCODING
_, invalid = ArgumentParser(USAGE).parse_args(args.split())
+ except Information:
+ return 'Does not execute - help or version option given'
+ except (DataError, Exception) as e: # DEBUG not being caught DataError?
+ return e.message
if bool(invalid):
return 'Unknown option(s): '+' '.join(invalid)
return None
- except DataError as e:
- return e.message
- except Information:
- return 'Does not execute - help or version option given'
def OnExcludeCheckbox(self, evt):
self.set_setting("apply_exclude_tags", evt.IsChecked())
