Skip to content

Commit b3f470b

Browse files
Milan Topuzovtishmen
authored andcommitted
[lint] base_import_async: named placeholders + wrap long line
1 parent 7f7a49e commit b3f470b

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

base_import_async/wizard/base_import_import.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def execute_import(self, fields, columns, options, dryrun=False):
5656
else:
5757
translated_model_name = self._description
5858
description = self.env._(
59-
"Import %s from file %s",
60-
translated_model_name,
61-
self.file_name,
59+
"Import %(model)s from file %(file_name)s",
60+
model=translated_model_name,
61+
file_name=self.file_name,
6262
)
6363
attachment = self._create_csv_attachment(
6464
import_fields, data, options, self.file_name
@@ -154,12 +154,15 @@ def _split_file(
154154
):
155155
chunk = str(priority - INIT_PRIORITY).zfill(padding)
156156
description = self.env._(
157-
"Import %s from file %s - #%s - lines %s to %s",
158-
translated_model_name,
159-
file_name,
160-
chunk,
161-
row_from + 1 + header_offset,
162-
row_to + 1 + header_offset,
157+
(
158+
"Import %(model)s from file %(file_name)s - #%(chunk)s - "
159+
"lines %(from_line)s to %(to_line)s"
160+
),
161+
model=translated_model_name,
162+
file_name=file_name,
163+
chunk=chunk,
164+
from_line=row_from + 1 + header_offset,
165+
to_line=row_to + 1 + header_offset,
163166
)
164167
# create a CSV attachment and enqueue the job
165168
root, ext = splitext(file_name)

0 commit comments

Comments
 (0)