scratchattach 2.1.10a3__py3-none-any.whl → 2.1.12__py3-none-any.whl

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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  scratchattach/__init__.py,sha256=2iiV0SghFUyJJrJYt668cSoDrxSjLCWNtzMdhttnMdA,1532
2
2
  scratchattach/cloud/__init__.py,sha256=MN7s4grQcciqUO7TiFjTbU2sC69m6XXlwOHNRbN3FKo,41
3
- scratchattach/cloud/_base.py,sha256=gMaZkiNL0MW7TjSmn_2d8en4GFYF5Bxyy-pPENKrBGc,17753
3
+ scratchattach/cloud/_base.py,sha256=3Kc1VKX6ogDqyItLUbHPom9DeGq7EUjpS0bjr-JuTHQ,17769
4
4
  scratchattach/cloud/cloud.py,sha256=TcIcY0tMe1jRdzxJrz6AIL0gW9xeMc9x4vNUCvBbRWY,7735
5
5
  scratchattach/editor/__init__.py,sha256=gfTQrtyQ-oZJBanp-5eNae72cwm4WoKHzNtZ4rn1dqg,727
6
6
  scratchattach/editor/asset.py,sha256=jNXJA09hU5b4ZTLegu7c0azlwHo5k_XZJfDN24uDux8,6078
@@ -28,7 +28,7 @@ scratchattach/eventhandlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
28
28
  scratchattach/eventhandlers/_base.py,sha256=8NjYF7qOEhjUFksA0qKg4XDH5aXgEG5PSVgMAYDbGD4,3078
29
29
  scratchattach/eventhandlers/cloud_events.py,sha256=iaUFo58D5JUCHstch2VhmhqMPq8WX_xrzPelFMCFRF8,4084
30
30
  scratchattach/eventhandlers/cloud_recorder.py,sha256=o4wcWJFCddpcSsPx5YU2DFFMFoKUknKM2RQ36HLpheQ,800
31
- scratchattach/eventhandlers/cloud_requests.py,sha256=Xmh_UmmgqM16OWduQo83-VqcSDfImOtUY8ur0y_4tQo,22080
31
+ scratchattach/eventhandlers/cloud_requests.py,sha256=jW3tLpfNmgsVuac5Y7vqx--qu1nQxytTV71Dx6ejGfU,22191
32
32
  scratchattach/eventhandlers/cloud_server.py,sha256=tah77FTr1Kp4DWpux48w8pJNZQL_1qL0hAXaAXlzQ9Y,12266
33
33
  scratchattach/eventhandlers/cloud_storage.py,sha256=9dvKPxbPZ_hBhw1HYlTl72YJmBo2OMwrSrMQ7kQwwOE,4660
34
34
  scratchattach/eventhandlers/combine.py,sha256=2n5SC6tSpgrmmK04sqsm4eqx26O9haBKA5YgsWNIoso,895
@@ -39,14 +39,14 @@ scratchattach/other/other_apis.py,sha256=7EyB3uB-1AYAH7Nb6eZ3VmACGdXvEQ39NJ1iahU
39
39
  scratchattach/other/project_json_capabilities.py,sha256=qSlJIJOgAxhSchD3fOIhK57rCe0_GrHadXBs5UXKuFU,22622
40
40
  scratchattach/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  scratchattach/site/_base.py,sha256=S-ynYKe7LslZxaZzE0hZsga0eLB2XlQo5erAfKct8yc,2193
42
- scratchattach/site/activity.py,sha256=a019lhoUwL9mdZI1Sz9mMg9EsDt2Lp5ziJSSDQ8-BWM,14319
42
+ scratchattach/site/activity.py,sha256=fczH9_v5CoFuMTobm7BcbnMy2scf9c2ZjzfIqBEOBes,14338
43
43
  scratchattach/site/backpack_asset.py,sha256=V_ypvTi-hqf0LF8zks2uHIicraBssc1_eEHVqHMzikc,3286
44
44
  scratchattach/site/browser_cookies.py,sha256=aaYLawtifngZ0pgaXHjBiWvYHUfflS8ZcXRjTTrge3A,1566
45
45
  scratchattach/site/classroom.py,sha256=WKMOcmYzKZx_EZNR4qipHOB8nxaggFe84lxqnrWd24E,16463
46
46
  scratchattach/site/cloud_activity.py,sha256=ie_DhChicks_RBagMM6_GfFIi1iAxf6UtJ3VFXC8StM,4159
47
47
  scratchattach/site/comment.py,sha256=Yt86iqwKZhCKNTEvB9DNDj9mXRV6A9qXyy1MrE7rMnA,8377
48
48
  scratchattach/site/forum.py,sha256=BZ_2jqDW3o-22AG1vP9s1W7l9yBbjBkFqG_DGV9IDuA,14802
49
- scratchattach/site/project.py,sha256=Mi5TAu31O07-Ue6N1jd_hwFwVpoTlzCdVBLv-xx7le4,30967
49
+ scratchattach/site/project.py,sha256=_yMzacrTiy_LYfyEfWVeoHRHm5t9vBUr88eR_ULcK7Q,30931
50
50
  scratchattach/site/session.py,sha256=mP4tTSZUs9dz0e3Zk6JF9RmSizFaYExbbEEYmA5TBnM,48278
51
51
  scratchattach/site/studio.py,sha256=Tv7AY1TwvlQpR9VjUEs-qmavrZsLxchkXk59aoH0_EI,22918
52
52
  scratchattach/site/user.py,sha256=TCO1QRtPeJdb3p-ziCwa6NqObHSNP0DMmcOl5De-Yl8,34496
@@ -56,8 +56,8 @@ scratchattach/utils/encoder.py,sha256=rqJfQ5gmjf7s8aTiGhR0W1ejYN5tHbAgJlxv7JhGqZ
56
56
  scratchattach/utils/enums.py,sha256=93ylCrxWycunahISSIjBqTIJ2r1Hb2b9RMvvzmUiQ-c,8294
57
57
  scratchattach/utils/exceptions.py,sha256=hrnPuXRRwR-kTHnrQVyfAD6PDOg1hZQd-jaXuUSNKSQ,6274
58
58
  scratchattach/utils/requests.py,sha256=x_EfcbLdBpQQuH9g4MMSaM8RN3tUm9OtzPEJQQiwilY,2709
59
- scratchattach-2.1.10a3.dist-info/licenses/LICENSE,sha256=1PRKLhZU4wYt5M-C9f7q0W3go3u_ojnZMNOdR3g3J-E,1080
60
- scratchattach-2.1.10a3.dist-info/METADATA,sha256=RzReJUHflsgc5P29JhmZkHG3eAMMkKRre5dK9LOD_Ms,5465
61
- scratchattach-2.1.10a3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
62
- scratchattach-2.1.10a3.dist-info/top_level.txt,sha256=gIwCwW39ohXn0JlnvSzAjV7VtL3qPlRnHiRqBbxsEUE,14
63
- scratchattach-2.1.10a3.dist-info/RECORD,,
59
+ scratchattach-2.1.12.dist-info/licenses/LICENSE,sha256=1PRKLhZU4wYt5M-C9f7q0W3go3u_ojnZMNOdR3g3J-E,1080
60
+ scratchattach-2.1.12.dist-info/METADATA,sha256=lvyNTW5sZGd0G6koIl1te2esiF4Y8oadiXZ_K9tcBQM,5463
61
+ scratchattach-2.1.12.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
62
+ scratchattach-2.1.12.dist-info/top_level.txt,sha256=gIwCwW39ohXn0JlnvSzAjV7VtL3qPlRnHiRqBbxsEUE,14
63
+ scratchattach-2.1.12.dist-info/RECORD,,