scratchattach 3.0.0b1__tar.gz → 3.0.0b2__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.
Files changed (101) hide show
  1. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/PKG-INFO +1 -1
  2. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/pyproject.toml +35 -29
  3. scratchattach-3.0.0b2/scratchattach/__init__.py +37 -0
  4. scratchattach-3.0.0b2/scratchattach/__main__.py +93 -0
  5. {scratchattach-3.0.0b1/scratchattach → scratchattach-3.0.0b2}/scratchattach.egg-info/PKG-INFO +1 -1
  6. {scratchattach-3.0.0b1/scratchattach → scratchattach-3.0.0b2}/scratchattach.egg-info/SOURCES.txt +8 -6
  7. scratchattach-3.0.0b2/scratchattach.egg-info/top_level.txt +1 -0
  8. scratchattach-3.0.0b1/scratchattach/scratchattach.egg-info/top_level.txt +0 -7
  9. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/LICENSE +0 -0
  10. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/README.md +0 -0
  11. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/__about__.py +0 -0
  12. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/__init__.py +0 -0
  13. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/cmd/__init__.py +0 -0
  14. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/cmd/group.py +0 -0
  15. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/cmd/login.py +0 -0
  16. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/cmd/profile.py +0 -0
  17. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/cmd/sessions.py +0 -0
  18. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/context.py +0 -0
  19. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/db.py +0 -0
  20. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cli/namespace.py +0 -0
  21. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cloud/__init__.py +0 -0
  22. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cloud/_base.py +0 -0
  23. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/cloud/cloud.py +0 -0
  24. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/__init__.py +0 -0
  25. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/asset.py +0 -0
  26. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/backpack_json.py +0 -0
  27. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/base.py +0 -0
  28. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/block.py +0 -0
  29. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/blockshape.py +0 -0
  30. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/build_defaulting.py +0 -0
  31. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/code_translation/__init__.py +0 -0
  32. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/code_translation/parse.py +0 -0
  33. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/comment.py +0 -0
  34. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/commons.py +0 -0
  35. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/extension.py +0 -0
  36. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/field.py +0 -0
  37. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/inputs.py +0 -0
  38. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/meta.py +0 -0
  39. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/monitor.py +0 -0
  40. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/mutation.py +0 -0
  41. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/pallete.py +0 -0
  42. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/prim.py +0 -0
  43. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/project.py +0 -0
  44. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/sprite.py +0 -0
  45. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/twconfig.py +0 -0
  46. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/editor/vlb.py +0 -0
  47. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/__init__.py +0 -0
  48. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/_base.py +0 -0
  49. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/cloud_events.py +0 -0
  50. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/cloud_recorder.py +0 -0
  51. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/cloud_requests.py +0 -0
  52. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/cloud_server.py +0 -0
  53. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/cloud_storage.py +0 -0
  54. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/combine.py +0 -0
  55. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/filterbot.py +0 -0
  56. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/eventhandlers/message_events.py +0 -0
  57. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/other/__init__.py +0 -0
  58. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/other/other_apis.py +0 -0
  59. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/other/project_json_capabilities.py +0 -0
  60. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/__init__.py +0 -0
  61. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/_base.py +0 -0
  62. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/activity.py +0 -0
  63. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/alert.py +0 -0
  64. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/backpack_asset.py +0 -0
  65. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/browser_cookie3_stub.py +0 -0
  66. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/browser_cookies.py +0 -0
  67. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/classroom.py +0 -0
  68. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/cloud_activity.py +0 -0
  69. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/comment.py +0 -0
  70. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/forum.py +0 -0
  71. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/placeholder.py +0 -0
  72. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/project.py +0 -0
  73. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/session.py +0 -0
  74. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/studio.py +0 -0
  75. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/typed_dicts.py +0 -0
  76. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/site/user.py +0 -0
  77. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/__init__.py +0 -0
  78. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/commons.py +0 -0
  79. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/encoder.py +0 -0
  80. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/enums.py +0 -0
  81. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/exceptions.py +0 -0
  82. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/optional_async.py +0 -0
  83. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/scratchattach/utils/requests.py +0 -0
  84. {scratchattach-3.0.0b1/scratchattach → scratchattach-3.0.0b2}/scratchattach.egg-info/dependency_links.txt +0 -0
  85. {scratchattach-3.0.0b1/scratchattach → scratchattach-3.0.0b2}/scratchattach.egg-info/entry_points.txt +0 -0
  86. {scratchattach-3.0.0b1/scratchattach → scratchattach-3.0.0b2}/scratchattach.egg-info/requires.txt +0 -0
  87. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/setup.cfg +0 -0
  88. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_activity.py +0 -0
  89. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_auth.py +0 -0
  90. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_comment.py +0 -0
  91. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_editor_integration.py +0 -0
  92. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_editor_obfuscation.py +0 -0
  93. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_editor_project.py +0 -0
  94. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_import.py +0 -0
  95. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_memberships.py +0 -0
  96. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_other_apis.py +0 -0
  97. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_project.py +0 -0
  98. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_search.py +0 -0
  99. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_studio.py +0 -0
  100. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_teacher_activity.py +0 -0
  101. {scratchattach-3.0.0b1 → scratchattach-3.0.0b2}/tests/test_user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scratchattach
3
- Version: 3.0.0b1
3
+ Version: 3.0.0b2
4
4
  Summary: A Scratch API Wrapper
5
5
  Author: TimMcCool
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scratchattach"
7
- version = "3.0.0b1"
7
+ version = "3.0.0b2"
8
8
  authors = [{ name = "TimMcCool" }]
9
9
  description = "A Scratch API Wrapper"
10
10
  requires-python = ">= 3.12"
@@ -55,41 +55,47 @@ lark = ["lark"]
55
55
  [tool.ruff]
56
56
  line-length = 127
57
57
  exclude = [
58
- ".bzr",
59
- ".direnv",
60
- ".eggs",
61
- ".git",
62
- ".git-rewrite",
63
- ".hg",
64
- ".ipynb_checkpoints",
65
- ".mypy_cache",
66
- ".nox",
67
- ".pants.d",
68
- ".pyenv",
69
- ".pytest_cache",
70
- ".pytype",
71
- ".ruff_cache",
72
- ".svn",
73
- ".tox",
74
- ".venv",
75
- ".vscode",
76
- "__pypackages__",
77
- "_build",
78
- "buck-out",
79
- "build",
80
- "dist",
81
- "node_modules",
82
- "site-packages",
83
- "venv",
58
+ ".bzr",
59
+ ".direnv",
60
+ ".eggs",
61
+ ".git",
62
+ ".git-rewrite",
63
+ ".hg",
64
+ ".ipynb_checkpoints",
65
+ ".mypy_cache",
66
+ ".nox",
67
+ ".pants.d",
68
+ ".pyenv",
69
+ ".pytest_cache",
70
+ ".pytype",
71
+ ".ruff_cache",
72
+ ".svn",
73
+ ".tox",
74
+ ".venv",
75
+ ".vscode",
76
+ "__pypackages__",
77
+ "_build",
78
+ "buck-out",
79
+ "build",
80
+ "dist",
81
+ "node_modules",
82
+ "site-packages",
83
+ "venv",
84
84
  ]
85
85
  [tool.ruff.lint]
86
- select = ["E9", "F63", "F7", "F82"] # , "C901"] # uncomment to re-enable mccabe complexity - see https://github.com/TimMcCool/scratchattach/issues/566
86
+ select = [
87
+ "E9",
88
+ "F63",
89
+ "F7",
90
+ "F82",
91
+ ] # , "C901"] # uncomment to re-enable mccabe complexity - see https://github.com/TimMcCool/scratchattach/issues/566
87
92
 
88
93
  [tool.ruff.lint.mccabe]
89
94
  # max-complexity = 10
90
95
 
91
96
  [tool.setuptools.packages.find]
92
- where = ["scratchattach"]
97
+ where = ["."]
98
+ include = ["scratchattach*"]
93
99
 
94
100
  [dependency-groups]
95
101
  dev = ["cryptography>=46.0.3", "pytest>=9.0.2"]
@@ -0,0 +1,37 @@
1
+ from .cloud.cloud import ScratchCloud, TwCloud, get_cloud, get_scratch_cloud, get_tw_cloud
2
+ from .cloud._base import BaseCloud, AnyCloud
3
+
4
+ from .eventhandlers.cloud_server import init_cloud_server
5
+ from .eventhandlers._base import BaseEventHandler
6
+ from .eventhandlers.filterbot import Filterbot, HardFilter, SoftFilter, SpamFilter
7
+ from .eventhandlers.cloud_storage import Database
8
+ from .eventhandlers.combine import MultiEventHandler
9
+
10
+ from .other.other_apis import *
11
+ # from .other.project_json_capabilities import ProjectBody, get_empty_project_pb, get_pb_from_dict, read_sb3_file, download_asset
12
+ from .utils.encoder import Encoding
13
+ from .utils.enums import Languages, TTSVoices
14
+ from .utils.exceptions import (
15
+ LoginDataWarning,
16
+ GetAuthenticationWarning,
17
+ StudioAuthenticationWarning,
18
+ ClassroomAuthenticationWarning,
19
+ ProjectAuthenticationWarning,
20
+ UserAuthenticationWarning)
21
+
22
+ from .site.activity import Activity, ActivityTypes
23
+ from .site.backpack_asset import BackpackAsset
24
+ from .site.comment import Comment, CommentSource
25
+ from .site.cloud_activity import CloudActivity
26
+ from .site.forum import ForumPost, ForumTopic, get_topic, get_topic_list, youtube_link_to_scratch
27
+ from .site.project import Project, get_project, search_projects, explore_projects
28
+ from .site.session import Session, login, login_by_id, login_by_session_string, login_by_io, login_by_file, \
29
+ login_from_browser
30
+ from .site.studio import Studio, get_studio, search_studios, explore_studios
31
+ from .site.classroom import Classroom, get_classroom
32
+ from .site.user import User, get_user, Rank
33
+ from .site._base import BaseSiteComponent
34
+ from .site.browser_cookies import Browser, ANY, FIREFOX, CHROME, CHROMIUM, VIVALDI, EDGE, EDGE_DEV, SAFARI
35
+ from .site.placeholder import PlaceholderProject, get_placeholder_project, create_placeholder_project
36
+
37
+ from . import editor
@@ -0,0 +1,93 @@
1
+ """
2
+ Scratchattach CLI. Most source code is in the `cli` directory
3
+ """
4
+
5
+ import argparse
6
+
7
+ from scratchattach import cli
8
+ from scratchattach.cli import db, cmd
9
+ from scratchattach.cli.context import ctx, console
10
+
11
+ import rich.traceback
12
+
13
+ rich.traceback.install()
14
+
15
+
16
+ # noinspection PyUnusedLocal
17
+ def main():
18
+ parser = argparse.ArgumentParser(
19
+ prog="scratch",
20
+ description="Scratchattach CLI",
21
+ epilog=f"Running scratchattach CLI version {cli.VERSION}",
22
+ )
23
+
24
+ # Using walrus operator & ifs for artificial indentation
25
+ if commands := parser.add_subparsers(dest="command"):
26
+ commands.add_parser("profile", help="View your profile")
27
+ commands.add_parser("sessions", help="View session list")
28
+ if login := commands.add_parser("login", help="Login to Scratch"):
29
+ login.add_argument("--sessid", dest="sessid", nargs="?", default=False, const=True,
30
+ help="Login by session ID")
31
+ if group := commands.add_parser("group", help="View current session group"):
32
+ if group_commands := group.add_subparsers(dest="group_command"):
33
+ group_commands.add_parser("list", help="List all session groups")
34
+ group_commands.add_parser("add", help="Add sessions to group")
35
+ group_commands.add_parser("remove", help="Remove sessions from a group")
36
+ group_commands.add_parser("delete", help="Delete current group")
37
+ if group_copy := group_commands.add_parser("copy", help="Copy current group with a new name"):
38
+ group_copy.add_argument("group_name", help="New group name")
39
+ if group_rename := group_commands.add_parser("rename", help="Rename current group"):
40
+ group_rename.add_argument("group_name", help="New group name")
41
+ if group_new := group_commands.add_parser("new", help="Create a new group"):
42
+ group_new.add_argument("group_name")
43
+ if group_switch := group_commands.add_parser("switch", help="Change the current group"):
44
+ group_switch.add_argument("group_name")
45
+
46
+ parser.add_argument("-U", "--username", dest="username", help="Name of user to look at")
47
+ parser.add_argument("-P", "--project", dest="project_id", help="ID of project to look at")
48
+ parser.add_argument("-S", "--studio", dest="studio_id", help="ID of studio to look at")
49
+ parser.add_argument("-L", "--session_name", dest="session_name",
50
+ help="Name of (registered) session/login to look at")
51
+
52
+ args = parser.parse_args(namespace=cli.ArgSpace())
53
+ cli.ctx.args = args
54
+ cli.ctx.parser = parser
55
+
56
+ match args.command:
57
+ case "sessions":
58
+ cmd.sessions()
59
+ case "login":
60
+ cmd.login()
61
+ case "group":
62
+ cmd.group()
63
+ case "profile":
64
+ cmd.profile()
65
+ case None:
66
+ if args.username:
67
+ user = ctx.session.connect_user(args.username)
68
+ console.print(cli.try_get_img(user.icon, (30, 30)))
69
+ console.print(user)
70
+ return
71
+ if args.studio_id:
72
+ studio = ctx.session.connect_studio(args.studio_id)
73
+ console.print(cli.try_get_img(studio.thumbnail, (34, 20)))
74
+ console.print(studio)
75
+ return
76
+ if args.project_id:
77
+ project = ctx.session.connect_project(args.project_id)
78
+ console.print(cli.try_get_img(project.thumbnail, (30, 23)))
79
+ console.print(project)
80
+ return
81
+ if args.session_name:
82
+ if sess := ctx.db_get_sess(args.session_name):
83
+ console.print(sess)
84
+ else:
85
+ raise ValueError(f"No session logged in called {args.session_name!r} "
86
+ f"- try using `scratch sessions` to see available sessions")
87
+ return
88
+
89
+ parser.print_help()
90
+
91
+
92
+ if __name__ == '__main__':
93
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scratchattach
3
- Version: 3.0.0b1
3
+ Version: 3.0.0b2
4
4
  Summary: A Scratch API Wrapper
5
5
  Author: TimMcCool
6
6
  License-Expression: MIT
@@ -1,6 +1,14 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
+ scratchattach/__init__.py
5
+ scratchattach/__main__.py
6
+ scratchattach.egg-info/PKG-INFO
7
+ scratchattach.egg-info/SOURCES.txt
8
+ scratchattach.egg-info/dependency_links.txt
9
+ scratchattach.egg-info/entry_points.txt
10
+ scratchattach.egg-info/requires.txt
11
+ scratchattach.egg-info/top_level.txt
4
12
  scratchattach/cli/__about__.py
5
13
  scratchattach/cli/__init__.py
6
14
  scratchattach/cli/context.py
@@ -50,12 +58,6 @@ scratchattach/eventhandlers/message_events.py
50
58
  scratchattach/other/__init__.py
51
59
  scratchattach/other/other_apis.py
52
60
  scratchattach/other/project_json_capabilities.py
53
- scratchattach/scratchattach.egg-info/PKG-INFO
54
- scratchattach/scratchattach.egg-info/SOURCES.txt
55
- scratchattach/scratchattach.egg-info/dependency_links.txt
56
- scratchattach/scratchattach.egg-info/entry_points.txt
57
- scratchattach/scratchattach.egg-info/requires.txt
58
- scratchattach/scratchattach.egg-info/top_level.txt
59
61
  scratchattach/site/__init__.py
60
62
  scratchattach/site/_base.py
61
63
  scratchattach/site/activity.py
@@ -0,0 +1 @@
1
+ scratchattach
@@ -1,7 +0,0 @@
1
- cli
2
- cloud
3
- editor
4
- eventhandlers
5
- other
6
- site
7
- utils
File without changes