scratchattach 2.1.10a2__tar.gz → 2.1.10a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/PKG-INFO +1 -1
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/_base.py +3 -2
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/user.py +13 -14
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/PKG-INFO +1 -1
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/setup.py +1 -1
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/LICENSE +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/README.md +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/cloud/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/cloud/_base.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/cloud/cloud.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/asset.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/backpack_json.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/base.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/block.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/blockshape.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/build_defaulting.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/comment.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/commons.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/extension.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/field.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/inputs.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/meta.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/monitor.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/mutation.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/pallete.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/prim.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/project.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/sbuild.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/sprite.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/twconfig.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/editor/vlb.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/_base.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_events.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_recorder.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_requests.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_server.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_storage.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/combine.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/filterbot.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/message_events.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/other/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/other/other_apis.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/other/project_json_capabilities.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/activity.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/backpack_asset.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/browser_cookies.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/classroom.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/cloud_activity.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/comment.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/forum.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/project.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/session.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/site/studio.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/__init__.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/commons.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/encoder.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/enums.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/exceptions.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/utils/requests.py +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/SOURCES.txt +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/dependency_links.txt +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/requires.txt +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/top_level.txt +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/setup.cfg +0 -0
- {scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/tests/test_import.py +0 -0
|
@@ -4,9 +4,10 @@ from abc import ABC, abstractmethod
|
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
6
|
from ..utils import exceptions, commons
|
|
7
|
+
from typing import TypeVar
|
|
7
8
|
from types import FunctionType
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
C = TypeVar("C", bound="BaseSiteComponent")
|
|
10
11
|
class BaseSiteComponent(ABC):
|
|
11
12
|
@abstractmethod
|
|
12
13
|
def __init__(self):
|
|
@@ -51,7 +52,7 @@ class BaseSiteComponent(ABC):
|
|
|
51
52
|
raise exceptions.Unauthenticated(
|
|
52
53
|
"You need to use session.connect_xyz (NOT get_xyz) in order to perform this operation.")
|
|
53
54
|
|
|
54
|
-
def _make_linked_object(self, identificator_id, identificator, Class, NotFoundException) ->
|
|
55
|
+
def _make_linked_object(self, identificator_id, identificator, Class: type[C], NotFoundException) -> C:
|
|
55
56
|
"""
|
|
56
57
|
Internal function for making a linked object (authentication kept) based on an identificator (like a project id or username)
|
|
57
58
|
Class must inherit from BaseSiteComponent
|
|
@@ -19,6 +19,17 @@ from . import activity
|
|
|
19
19
|
|
|
20
20
|
from ..utils.requests import Requests as requests
|
|
21
21
|
|
|
22
|
+
class Verificator:
|
|
23
|
+
|
|
24
|
+
def __init__(self, user: User, project_id: int):
|
|
25
|
+
self.project = user._make_linked_object("id", project_id, project.Project, exceptions.ProjectNotFound)
|
|
26
|
+
self.projecturl = self.project.url
|
|
27
|
+
self.code = ''.join(random.choices(string.ascii_letters + string.digits, k=8))
|
|
28
|
+
self.username = user.username
|
|
29
|
+
|
|
30
|
+
def check(self) -> bool:
|
|
31
|
+
return bool(list(filter(lambda x : x.author_name == self.username and (x.content == self.code or x.content.startswith(self.code) or x.content.endswith(self.code)), self.project.comments())))
|
|
32
|
+
|
|
22
33
|
class User(BaseSiteComponent):
|
|
23
34
|
|
|
24
35
|
'''
|
|
@@ -799,20 +810,8 @@ class User(BaseSiteComponent):
|
|
|
799
810
|
It will return True if the user commented the code.
|
|
800
811
|
"""
|
|
801
812
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
def __init__(self, user):
|
|
805
|
-
self.project = user._make_linked_object("id", verification_project_id, project.Project, exceptions.ProjectNotFound)
|
|
806
|
-
self.projecturl = self.project.url
|
|
807
|
-
self.code = ''.join(random.choices(string.ascii_letters + string.digits, k=130))
|
|
808
|
-
self.username = user.username
|
|
809
|
-
|
|
810
|
-
def check(self):
|
|
811
|
-
return list(filter(lambda x : x.author_name == self.username, self.project.comments())) != []
|
|
812
|
-
|
|
813
|
-
v = Verificator(self)
|
|
814
|
-
print(f"{self.username} has to go to {v.projecturl} and comment {v.code} to verify their identity")
|
|
815
|
-
return Verificator(self)
|
|
813
|
+
v = Verificator(self, verification_project_id)
|
|
814
|
+
return v
|
|
816
815
|
|
|
817
816
|
# ------ #
|
|
818
817
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_events.py
RENAMED
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_recorder.py
RENAMED
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_requests.py
RENAMED
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_server.py
RENAMED
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/cloud_storage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/eventhandlers/message_events.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach/other/project_json_capabilities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scratchattach-2.1.10a2 → scratchattach-2.1.10a3}/scratchattach.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|