99from io import BytesIO
1010
1111from typing import Any
12+ from typing_extensions import deprecated
1213from . import user , comment , studio
1314from scratchattach .utils import exceptions
1415from scratchattach .utils import commons
@@ -487,8 +488,8 @@ def set_fields(self, fields_dict, *, use_site_api=False):
487488 use_site_api (bool):
488489 When enabled, the fields are set using the scratch.mit.edu/site-api API.
489490 This function allows setting more fields than Project.set_fields.
490- For example you can also share / unshare the project by setting the "shared" field.
491- According to the Scratch team, this API is deprecated. As of 2024 it's still fully functional tho .
491+ For example, you can also share / unshare the project by setting the "shared" field.
492+ According to the Scratch team, this API is deprecated. As of 2024 it's still fully functional though .
492493 """
493494 self ._assert_permission ()
494495 if use_site_api :
@@ -716,7 +717,7 @@ def set_notes(self, text):
716717 """
717718 self .set_fields ({"description" : text })
718719
719-
720+ @ deprecated ( "Deprecated because ScratchDB is down indefinitely." )
720721 def ranks (self ):
721722 """
722723 Gets information about the project's ranks. Fetched from ScratchDB.
@@ -727,7 +728,6 @@ def ranks(self):
727728 Returns:
728729 dict: A dict containing the project's ranks. If the ranks aren't available, all values will be -1.
729730 """
730- print ("Warning: Project.ranks method is deprecated because ScratchDB is down indefinitely." )
731731 return requests .get (
732732 f"https://scratchdb.lefty.one/v3/project/info/{ self .id } "
733733 ).json ()["statistics" ]["ranks" ]
0 commit comments