Skip to content

Commit 01c2f00

Browse files
committed
changed service.py
1 parent 9149b79 commit 01c2f00

File tree

17 files changed

+971
-1353
lines changed

17 files changed

+971
-1353
lines changed

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from packaging.version import parse # noqa
99
from superannotate.lib.app.analytics.class_analytics import class_distribution # noqa
1010
from superannotate.lib.app.exceptions import AppException # noqa
11-
from superannotate.lib.app.input_converters import convert_json_version
11+
from superannotate.lib.app.input_converters import convert_json_version # noqa
1212
from superannotate.lib.app.input_converters import convert_project_type # noqa
1313
from superannotate.lib.app.input_converters import export_annotation # noqa
1414
from superannotate.lib.app.input_converters import import_annotation # noqa

src/superannotate/lib/app/helpers.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import uuid
23
from pathlib import Path
34
from typing import List
@@ -128,3 +129,18 @@ def get_name_url_duplicated_from_csv(csv_path):
128129
else:
129130
duplicate_images.append(temp)
130131
return images_to_upload, duplicate_images
132+
133+
134+
def get_tabulation() -> int:
135+
try:
136+
return int(os.get_terminal_size().columns / 2)
137+
except OSError:
138+
return 48
139+
140+
141+
def wrap_error(errors_list: List[Tuple[str, str]]) -> str:
142+
tabulation = get_tabulation()
143+
msgs = []
144+
for key, value in errors_list:
145+
msgs.append("{}{}{}".format(key, " " * (tabulation - len(key)), value))
146+
return "\n".join(msgs)

0 commit comments

Comments
 (0)