scratchattach 2.1.10a3__tar.gz → 2.1.12__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 (69) hide show
  1. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/PKG-INFO +1 -1
  2. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/cloud/_base.py +2 -2
  3. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/cloud_requests.py +6 -4
  4. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/activity.py +2 -2
  5. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/project.py +0 -2
  6. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach.egg-info/PKG-INFO +1 -1
  7. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/setup.py +1 -1
  8. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/LICENSE +0 -0
  9. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/README.md +0 -0
  10. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/__init__.py +0 -0
  11. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/cloud/__init__.py +0 -0
  12. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/cloud/cloud.py +0 -0
  13. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/__init__.py +0 -0
  14. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/asset.py +0 -0
  15. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/backpack_json.py +0 -0
  16. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/base.py +0 -0
  17. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/block.py +0 -0
  18. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/blockshape.py +0 -0
  19. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/build_defaulting.py +0 -0
  20. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/comment.py +0 -0
  21. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/commons.py +0 -0
  22. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/extension.py +0 -0
  23. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/field.py +0 -0
  24. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/inputs.py +0 -0
  25. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/meta.py +0 -0
  26. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/monitor.py +0 -0
  27. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/mutation.py +0 -0
  28. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/pallete.py +0 -0
  29. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/prim.py +0 -0
  30. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/project.py +0 -0
  31. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/sbuild.py +0 -0
  32. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/sprite.py +0 -0
  33. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/twconfig.py +0 -0
  34. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/editor/vlb.py +0 -0
  35. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/__init__.py +0 -0
  36. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/_base.py +0 -0
  37. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/cloud_events.py +0 -0
  38. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/cloud_recorder.py +0 -0
  39. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/cloud_server.py +0 -0
  40. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/cloud_storage.py +0 -0
  41. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/combine.py +0 -0
  42. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/filterbot.py +0 -0
  43. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/eventhandlers/message_events.py +0 -0
  44. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/other/__init__.py +0 -0
  45. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/other/other_apis.py +0 -0
  46. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/other/project_json_capabilities.py +0 -0
  47. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/__init__.py +0 -0
  48. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/_base.py +0 -0
  49. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/backpack_asset.py +0 -0
  50. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/browser_cookies.py +0 -0
  51. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/classroom.py +0 -0
  52. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/cloud_activity.py +0 -0
  53. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/comment.py +0 -0
  54. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/forum.py +0 -0
  55. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/session.py +0 -0
  56. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/studio.py +0 -0
  57. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/site/user.py +0 -0
  58. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/__init__.py +0 -0
  59. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/commons.py +0 -0
  60. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/encoder.py +0 -0
  61. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/enums.py +0 -0
  62. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/exceptions.py +0 -0
  63. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach/utils/requests.py +0 -0
  64. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach.egg-info/SOURCES.txt +0 -0
  65. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach.egg-info/dependency_links.txt +0 -0
  66. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach.egg-info/requires.txt +0 -0
  67. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/scratchattach.egg-info/top_level.txt +0 -0
  68. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/setup.cfg +0 -0
  69. {scratchattach-2.1.10a3 → scratchattach-2.1.12}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scratchattach
3
- Version: 2.1.10a3
3
+ Version: 2.1.12
4
4
  Summary: A Scratch API Wrapper
5
5
  Home-page: https://scratchattach.tim1de.net
6
6
  Author: TimMcCool
@@ -142,7 +142,7 @@ class WebSocketEventStream(EventStream):
142
142
  i = 0
143
143
  with self.reading:
144
144
  try:
145
- self.receive_new(True)
145
+ self.receive_new(amount != -1)
146
146
  while (self.packets_left and amount == -1) or (amount != -1 and i < amount):
147
147
  if not self.packets_left and amount != -1:
148
148
  self.receive_new()
@@ -150,7 +150,7 @@ class WebSocketEventStream(EventStream):
150
150
  i += 1
151
151
  except Exception:
152
152
  self.source_cloud.reconnect()
153
- self.receive_new(True)
153
+ self.receive_new(amount != -1)
154
154
  while (self.packets_left and amount == -1) or (amount != -1 and i < amount):
155
155
  if not self.packets_left and amount != -1:
156
156
  self.receive_new()
@@ -23,7 +23,7 @@ class Request:
23
23
  self.enabled = enabled
24
24
  self.response_priority = response_priority
25
25
  self.cloud_requests = cloud_requests # the corresponding CloudRequests object
26
- self.debug = debug
26
+ self.debug = debug or self.cloud_requests.debug
27
27
 
28
28
  def __call__(self, received_request):
29
29
  if not self.enabled:
@@ -63,7 +63,7 @@ class CloudRequests(CloudEvents):
63
63
 
64
64
  # The CloudRequests class is built upon CloudEvents, similar to how Filterbot is built upon MessageEvents
65
65
 
66
- def __init__(self, cloud, used_cloud_vars=["1", "2", "3", "4", "5", "6", "7", "8", "9"], no_packet_loss=False, respond_order="receive"):
66
+ def __init__(self, cloud, used_cloud_vars=["1", "2", "3", "4", "5", "6", "7", "8", "9"], no_packet_loss=False, respond_order="receive", debug=False):
67
67
  super().__init__(cloud)
68
68
  # Setup
69
69
  self._requests = {}
@@ -73,6 +73,7 @@ class CloudRequests(CloudEvents):
73
73
  self.no_packet_loss = no_packet_loss # When enabled, query the clouddata log regularly for missed requests and reconnect after every single request (reduces packet loss a lot, but is spammy and can make response duration longer)
74
74
  self.used_cloud_vars = used_cloud_vars
75
75
  self.respond_order = respond_order
76
+ self.debug = debug
76
77
 
77
78
  # Lists and dicts for saving request-related stuff
78
79
  self.request_parts = {} # Dict (key: request_id) for saving the parts of the requests not fully received yet
@@ -99,7 +100,7 @@ class CloudRequests(CloudEvents):
99
100
 
100
101
  # -- Adding and removing requests --
101
102
 
102
- def request(self, function=None, *, enabled=True, name=None, thread=True, response_priority=0):
103
+ def request(self, function=None, *, enabled=True, name=None, thread=True, response_priority=0, debug=False):
103
104
  """
104
105
  Decorator function. Adds a request to the request handler.
105
106
  """
@@ -113,7 +114,8 @@ class CloudRequests(CloudEvents):
113
114
  thread=thread,
114
115
  response_priority=response_priority,
115
116
  on_call=function,
116
- cloud_requests=self
117
+ cloud_requests=self,
118
+ debug=debug
117
119
  )
118
120
 
119
121
  if function is None:
@@ -14,9 +14,9 @@ class Activity(BaseSiteComponent):
14
14
  """
15
15
 
16
16
  def __repr__(self):
17
- return repr(self.raw)
17
+ return f"Activity({repr(self.raw)})"
18
18
 
19
- def str(self):
19
+ def __str__(self):
20
20
  return str(self.raw)
21
21
 
22
22
  def __init__(self, **entries):
@@ -136,8 +136,6 @@ class PartialProject(BaseSiteComponent):
136
136
  """
137
137
  self._assert_auth()
138
138
 
139
- global CREATE_PROJECT_USES
140
-
141
139
  if title is None:
142
140
  if "title" in self.__dict__:
143
141
  title = self.title+" remix"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scratchattach
3
- Version: 2.1.10a3
3
+ Version: 2.1.12
4
4
  Summary: A Scratch API Wrapper
5
5
  Home-page: https://scratchattach.tim1de.net
6
6
  Author: TimMcCool
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import codecs
3
3
  import os
4
4
 
5
- VERSION = '2.1.10a3'
5
+ VERSION = '2.1.12'
6
6
  DESCRIPTION = 'A Scratch API Wrapper'
7
7
  LONG_DESCRIPTION = DESCRIPTION
8
8
 
File without changes