kalenislims/lims_instrument_custom_set/custom_set_csv.py

23 lines
608 B
Python
Raw Normal View History

2017-10-08 02:23:22 +02:00
# -*- coding: utf-8 -*-
# This file is part of lims_instrument_custom_set module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
2019-03-04 15:41:58 +01:00
import io
2017-10-08 02:23:22 +02:00
import csv
from trytond.transaction import Transaction
def getControllerName():
if Transaction().language in ('es', 'es_419'):
2019-03-04 15:41:58 +01:00
return 'Planilla personalizada - CSV'
2017-10-08 02:23:22 +02:00
else:
2019-03-04 15:41:58 +01:00
return 'Custom Set - CSV'
2017-10-08 02:23:22 +02:00
def parse(self, infile):
2019-03-04 15:41:58 +01:00
filedata = io.StringIO(infile)
2017-10-08 02:23:22 +02:00
reader = csv.reader(filedata)
for line in reader:
2019-03-04 15:41:58 +01:00
print((str(', '.join(line), 'utf-8')))