Skip to content

Commit 81f5938

Browse files
committed
Fix message
1 parent b99f7da commit 81f5938

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,12 @@ def attach_image_urls_to_project(
23562356
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
23572357
list_of_uploaded = []
23582358

2359-
logger.info("Attaching %s images to project.", len(images_to_upload))
2359+
if len(duplicate_images):
2360+
logger.warning(
2361+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2362+
)
2363+
2364+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))
23602365

23612366
with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
23622367
for i in range(0, len(images_to_upload), 500):
@@ -2408,7 +2413,12 @@ def attach_video_urls_to_project(
24082413
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
24092414
list_of_uploaded = []
24102415

2411-
logger.info("Attaching %s images to project.", len(images_to_upload))
2416+
if len(duplicate_images):
2417+
logger.warning(
2418+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2419+
)
2420+
2421+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))
24122422

24132423
with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
24142424
for i in range(0, len(images_to_upload), 500):
@@ -3636,7 +3646,12 @@ def attach_document_urls_to_project(
36363646
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
36373647
list_of_uploaded = []
36383648

3639-
logger.info("Attaching %s images to project.", len(images_to_upload))
3649+
if len(duplicate_images):
3650+
logger.warning(
3651+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
3652+
)
3653+
3654+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))
36403655

36413656
with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
36423657
for i in range(0, len(images_to_upload), 500):

src/superannotate/lib/core/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
MAX_IMAGE_SIZE = 100 * 1024 * 1024 # 100 MB limit
5555
TOKEN_UUID = "token"
5656

57+
ALREADY_EXISTING_FILES_WARNING = (
58+
"{} already existing file(s) found that won't be uploaded."
59+
)
60+
ATTACHING_FILES_MESSAGE = "Attaching {} file(s) to project."
5761

5862
DEPRECATED_VIDEO_PROJECTS_MESSAGE = (
5963
"The function does not support projects containing videos attached with URLs"

0 commit comments

Comments
 (0)