1
0
forked from ScoDoc/ScoDoc

Fix: typo msg erreur dans export APo

This commit is contained in:
Emmanuel Viennet 2023-03-16 12:46:27 +01:00
parent 51858b6b8b
commit 2393a872a5

View File

@ -177,7 +177,7 @@ def fix_data_encoding(
return text, message
class StringIOFileLineWrapper(object):
class StringIOFileLineWrapper:
def __init__(self, data: str):
self.f = io.StringIO(data)
self.lineno = 0
@ -1098,14 +1098,14 @@ def _apo_read_cols(f):
# sanity check
col_id = fs[0] # apoL_c0001, ...
if col_id in cols:
raise ScoFormatError("duplicate column definition: %s" % col_id)
raise ScoFormatError(f"duplicate column definition: {col_id}")
m = re.match(r"^apoL_c([0-9]{4})$", col_id)
if not m:
raise ScoFormatError(
"invalid column id: %s (expecting apoL_c%04d)" % (line, col_id)
f"invalid column id: {line} (expecting apoL_c{col_id})"
)
if int(m.group(1)) != i:
raise ScoFormatError("invalid column id: %s for index %s" % (col_id, i))
raise ScoFormatError(f"invalid column id: {col_id} for index {i}")
cols[col_id] = DictCol(list(zip(col_keys, fs)))
cols[col_id].lineno = f.lineno # for debuging purpose
@ -1127,11 +1127,10 @@ def _apo_read_TITRES(f):
if len(fields) == 2:
k, v = fields
else:
log("Error read CSV: \nline=%s\nfields=%s" % (line, fields))
log(f"Error read CSV: \nline={line}\nfields={fields}")
log(dir(f))
raise ScoFormatError(
"Fichier Apogee incorrect (section titres, %d champs au lieu de 2)"
% len(fields)
f"Fichier Apogee incorrect (section titres, {len(fields)} champs au lieu de 2)"
)
d[k] = v
#