Handle invalid delimiters more gracefully

This commit is contained in:
luoliyan 2017-02-13 21:42:19 +09:30
parent 6df5ce71a0
commit 7002a2a4f8

View file

@ -112,6 +112,11 @@ you can enter it here. Use \\t to represent tab."""),
self, help="importing") or "\t" self, help="importing") or "\t"
str = str.replace("\\t", "\t") str = str.replace("\\t", "\t")
str = str.encode("ascii") str = str.encode("ascii")
if len(str) > 1:
showWarning(_(
"Multi-character separators are not supported. "
"Please enter one character only."))
return
self.hideMapping() self.hideMapping()
def updateDelim(): def updateDelim():
self.importer.delimiter = str self.importer.delimiter = str