Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
fixed: Python scripting: select() had problems with unicode strings a…
Browse files Browse the repository at this point in the history
…nd default = 0
  • Loading branch information
RaiMan committed Dec 1, 2016
1 parent 30dc0ab commit db98e15
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions API/src/main/resources/Lib/sikuli/Sikuli.py
Expand Up @@ -422,14 +422,17 @@ def inputText(msg="", title="", lines=0, width=0, text=""):
# @param msg the message to display.
# @param title the title for the dialog
def select(msg="", title="Sikuli Selection", options=(), default=None):
if len(options) == 0:
optionsLen = len(options)
if optionsLen == 0:
return ""
if default:
if not __builtin__.type(default) is types.StringType:
try:
default = options[default]
except:
default = None
try:
default = 0 + default;
if default > -1 and default < optionsLen:
default = options[default]
else:
default = None
except:
pass
return Sikulix.popSelect(msg, title, options, default)

def popFile(title = "Select File or Folder"):
Expand Down

0 comments on commit db98e15

Please sign in to comment.