mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Window: Fix paste delimiter.
This commit is contained in:
1 parent
ddfaa3a73f
commit
461202219d
1 file changed
+8
-2
@@ -68,14 +68,20 @@ class WindowToolKit(object):
|
|||||||
header = []
|
header = []
|
||||||
values = []
|
values = []
|
||||||
|
|
||||||
|
delimiter = '\t'
|
||||||
|
if ';' in data:
|
||||||
|
delimiter = ';'
|
||||||
|
if ' ' in data:
|
||||||
|
delimiter = ' '
|
||||||
|
|
||||||
stream = StringIO(data)
|
stream = StringIO(data)
|
||||||
rows = csv.reader(stream, delimiter='\t')
|
rows = csv.reader(stream, delimiter=delimiter)
|
||||||
for ind, row in enumerate(rows):
|
for ind, row in enumerate(rows):
|
||||||
if has_header and ind == 0:
|
if has_header and ind == 0:
|
||||||
header = row.copy()
|
header = row.copy()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
values.append(row)
|
values.append(list(filter(lambda s: s != '', row)))
|
||||||
|
|
||||||
return header, values
|
return header, values
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user