mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Handle invalid delimiters more gracefully
This commit is contained in:
parent
6df5ce71a0
commit
7002a2a4f8
1 changed files with 6 additions and 1 deletions
|
@ -112,6 +112,11 @@ you can enter it here. Use \\t to represent tab."""),
|
|||
self, help="importing") or "\t"
|
||||
str = str.replace("\\t", "\t")
|
||||
str = str.encode("ascii")
|
||||
if len(str) > 1:
|
||||
showWarning(_(
|
||||
"Multi-character separators are not supported. "
|
||||
"Please enter one character only."))
|
||||
return
|
||||
self.hideMapping()
|
||||
def updateDelim():
|
||||
self.importer.delimiter = str
|
||||
|
@ -140,7 +145,7 @@ you can enter it here. Use \\t to represent tab."""),
|
|||
d = repr(d)
|
||||
txt = _("Fields separated by: %s") % d
|
||||
self.frm.autoDetect.setText(txt)
|
||||
|
||||
|
||||
def accept(self):
|
||||
self.importer.mapping = self.mapping
|
||||
if not self.importer.mappingOk():
|
||||
|
|
Loading…
Reference in a new issue