@@ -630,39 +630,6 @@ def pin_image(
630630 is_pinned = int (pin ),
631631 )
632632
633- def delete_images (
634- self , project : Union [NotEmptyStr , dict ], image_names : Optional [List [str ]] = None
635- ):
636- """Delete Images in project.
637-
638- :param project: project name or folder path (e.g., "project1/folder1")
639- :type project: str
640- :param image_names: to be deleted images' names. If None, all the images will be deleted
641- :type image_names: list of strs
642- """
643-
644- warning_msg = (
645- "We're deprecating the delete_images function. Please use delete_items instead."
646- "Learn more. \n "
647- "https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html#superannotate.delete_items"
648- )
649- logger .warning (warning_msg )
650- warnings .warn (warning_msg , DeprecationWarning )
651- project_name , folder_name = extract_project_folder (project )
652-
653- if not isinstance (image_names , list ) and image_names is not None :
654- raise AppException ("image_names should be a list of str or None." )
655-
656- response = self .controller .delete_images (
657- project_name = project_name , folder_name = folder_name , image_names = image_names
658- )
659- if response .errors :
660- raise AppException (response .errors )
661-
662- logger .info (
663- f"Images deleted in project { project_name } { '/' + folder_name if folder_name else '' } "
664- )
665-
666633 def delete_items (self , project : str , items : Optional [List [str ]] = None ):
667634 """Delete items in a given project.
668635
@@ -724,91 +691,6 @@ def unassign_items(
724691 if response .errors :
725692 raise AppException (response .errors )
726693
727- def assign_images (
728- self , project : Union [NotEmptyStr , dict ], image_names : List [str ], user : str
729- ):
730- """Assigns images to a user. The assignment role, QA or Annotator, will
731- be deduced from the user's role in the project. With SDK, the user can be
732- assigned to a role in the project with the share_project function.
733-
734- :param project: project name or folder path (e.g., "project1/folder1")
735- :type project: str
736- :param image_names: list of image names to assign
737- :type image_names: list of str
738- :param user: user email
739- :type user: str
740- """
741-
742- warning_msg = (
743- "We're deprecating the assign_images function. Please use assign_items instead."
744- "Learn more. \n "
745- "https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html#superannotate.assign_items"
746- )
747- logger .warning (warning_msg )
748- warnings .warn (warning_msg , DeprecationWarning )
749- project_name , folder_name = extract_project_folder (project )
750- project = self .controller .get_project_metadata (project_name ).data
751-
752- if project ["project" ].type in [
753- constants .ProjectType .VIDEO .value ,
754- constants .ProjectType .DOCUMENT .value ,
755- ]:
756- raise AppException (LIMITED_FUNCTIONS [project ["project" ].type ])
757-
758- contributors = (
759- self .controller .get_project_metadata (
760- project_name = project_name , include_contributors = True
761- )
762- .data ["project" ]
763- .users
764- )
765- contributor = None
766- for c in contributors :
767- if c ["user_id" ] == user :
768- contributor = user
769-
770- if not contributor :
771- logger .warning (
772- f"Skipping { user } . { user } is not a verified contributor for the { project_name } "
773- )
774- return
775-
776- response = self .controller .assign_images (
777- project_name , folder_name , image_names , user
778- )
779- if not response .errors :
780- logger .info (f"Assign images to user { user } " )
781- else :
782- raise AppException (response .errors )
783-
784- def unassign_images (
785- self , project : Union [NotEmptyStr , dict ], image_names : List [NotEmptyStr ]
786- ):
787- """Removes assignment of given images for all assignees. With SDK,
788- the user can be assigned to a role in the project with the share_project
789- function.
790-
791- :param project: project name or folder path (e.g., "project1/folder1")
792- :type project: str
793- :param image_names: list of images to unassign
794- :type image_names: list of str
795- """
796-
797- warning_msg = (
798- "We're deprecating the unassign_images function. Please use unassign_items instead."
799- "Learn more. \n "
800- "https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html#superannotate.unassign_items"
801- )
802- logger .warning (warning_msg )
803- warnings .warn (warning_msg , DeprecationWarning )
804- project_name , folder_name = extract_project_folder (project )
805-
806- response = self .controller .un_assign_images (
807- project_name = project_name , folder_name = folder_name , image_names = image_names
808- )
809- if response .errors :
810- raise AppException (response .errors )
811-
812694 def unassign_folder (self , project_name : NotEmptyStr , folder_name : NotEmptyStr ):
813695 """Removes assignment of given folder for all assignees.
814696 With SDK, the user can be assigned to a role in the project
0 commit comments