Commit 8ba7acdf by Celine Mercier

export: fixed a bug where exporting to tab format with a header would

not export the first line of data and switch to version 3.0.0b39
parent 38051b1e
......@@ -23,9 +23,8 @@ cdef class TabFormat:
if self.first_line:
self.tags = [k for k in data.keys()]
for k in self.tags:
if self.header and self.first_line:
if self.header and self.first_line:
for k in self.tags:
if isinstance(data.view[k], Column_multi_elts):
keys = data.view[k].keys()
keys.sort()
......@@ -33,27 +32,36 @@ cdef class TabFormat:
line.append(tobytes(k)+b':'+tobytes(k2))
else:
line.append(tobytes(k))
else:
value = data[k]
if isinstance(data.view[k], Column_multi_elts):
keys = data.view[k].keys()
keys.sort()
if value is None: # all keys at None
for k2 in keys: # TODO could be much more efficient
r = self.sep.join(value for value in line)
r += b'\n'
line = []
for k in self.tags:
value = data[k]
if isinstance(data.view[k], Column_multi_elts):
keys = data.view[k].keys()
keys.sort()
if value is None: # all keys at None
for k2 in keys: # TODO could be much more efficient
line.append(self.NAString)
else:
for k2 in keys: # TODO could be much more efficient
if value[k2] is not None:
line.append(str2bytes(str(bytes2str_object(value[k2])))) # genius programming
else:
line.append(self.NAString)
else:
for k2 in keys: # TODO could be much more efficient
if value[k2] is not None:
line.append(str2bytes(str(bytes2str_object(value[k2])))) # genius programming
else:
line.append(self.NAString)
else:
if value is not None:
line.append(str2bytes(str(bytes2str_object(value))))
else:
if value is not None:
line.append(str2bytes(str(bytes2str_object(value))))
else:
line.append(self.NAString)
line.append(self.NAString)
if self.header and self.first_line:
r += self.sep.join(value for value in line)
else:
r = self.sep.join(value for value in line)
if self.first_line:
self.first_line = False
return self.sep.join(value for value in line)
return r
major = 3
minor = 0
serial= '0b38'
serial= '0b39'
version ="%d.%d.%s" % (major,minor,serial)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment