mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 11:01:09 +00:00
Change CSV to have unix style line endings
The excel dialog has nice minimal quoting, but DOS line endings. Unix dialog has good line endings, but excessive quoting. Create a hybrid dialect and use it for nodesensors output.
This commit is contained in:
parent
b74d648e7f
commit
5fea265dc8
@ -32,6 +32,13 @@ path = os.path.realpath(os.path.join(path, '..', 'lib', 'python'))
|
||||
if path.startswith('/opt'):
|
||||
sys.path.append(path)
|
||||
|
||||
|
||||
class hybridcsv(csv.excel):
|
||||
lineterminator = '\n'
|
||||
|
||||
|
||||
csv.register_dialect('hybrid', hybridcsv)
|
||||
|
||||
import confluent.client as client
|
||||
|
||||
sensorcollections = {
|
||||
@ -209,7 +216,7 @@ def main():
|
||||
headernames.append(headername)
|
||||
if options.csv:
|
||||
linebyline = False
|
||||
csvwriter = csv.writer(sys.stdout)
|
||||
csvwriter = csv.writer(sys.stdout, dialect='hybrid')
|
||||
if options.interval:
|
||||
csvwriter.writerow(['time', 'node'] + headernames)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user