pumpkin-api-py 0.1.0.dev0__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.
Files changed (75) hide show
  1. pumpkin_api/__init__.py +139 -0
  2. pumpkin_api/app.py +8 -0
  3. pumpkin_api/build.py +35 -0
  4. pumpkin_api/wit/componentize_py_async_support/__init__.py +529 -0
  5. pumpkin_api/wit/componentize_py_async_support/futures.py +93 -0
  6. pumpkin_api/wit/componentize_py_async_support/streams.py +189 -0
  7. pumpkin_api/wit/componentize_py_runtime.pyi +34 -0
  8. pumpkin_api/wit/componentize_py_types.py +19 -0
  9. pumpkin_api/wit/poll_loop.py +440 -0
  10. pumpkin_api/wit/wit_world/__init__.py +70 -0
  11. pumpkin_api/wit/wit_world/exports/__init__.py +19 -0
  12. pumpkin_api/wit/wit_world/exports/metadata.py +22 -0
  13. pumpkin_api/wit/wit_world/imports/__init__.py +0 -0
  14. pumpkin_api/wit/wit_world/imports/command.py +539 -0
  15. pumpkin_api/wit/wit_world/imports/common.py +213 -0
  16. pumpkin_api/wit/wit_world/imports/context.py +70 -0
  17. pumpkin_api/wit/wit_world/imports/entity.py +84 -0
  18. pumpkin_api/wit/wit_world/imports/event.py +434 -0
  19. pumpkin_api/wit/wit_world/imports/gui.py +61 -0
  20. pumpkin_api/wit/wit_world/imports/i18n.py +35 -0
  21. pumpkin_api/wit/wit_world/imports/logging.py +30 -0
  22. pumpkin_api/wit/wit_world/imports/permission.py +71 -0
  23. pumpkin_api/wit/wit_world/imports/player.py +350 -0
  24. pumpkin_api/wit/wit_world/imports/scheduler.py +44 -0
  25. pumpkin_api/wit/wit_world/imports/scoreboard.py +95 -0
  26. pumpkin_api/wit/wit_world/imports/server.py +75 -0
  27. pumpkin_api/wit/wit_world/imports/text.py +89 -0
  28. pumpkin_api/wit/wit_world/imports/world.py +215 -0
  29. pumpkin_api/wit_files/command.wit +189 -0
  30. pumpkin_api/wit_files/common.wit +201 -0
  31. pumpkin_api/wit_files/componentize_py_async_support/__init__.py +529 -0
  32. pumpkin_api/wit_files/componentize_py_async_support/futures.py +93 -0
  33. pumpkin_api/wit_files/componentize_py_async_support/streams.py +189 -0
  34. pumpkin_api/wit_files/componentize_py_runtime.pyi +34 -0
  35. pumpkin_api/wit_files/componentize_py_types.py +19 -0
  36. pumpkin_api/wit_files/context.wit +33 -0
  37. pumpkin_api/wit_files/entity.wit +36 -0
  38. pumpkin_api/wit_files/event.wit +311 -0
  39. pumpkin_api/wit_files/gui.wit +38 -0
  40. pumpkin_api/wit_files/i18n.wit +21 -0
  41. pumpkin_api/wit_files/log.wit +14 -0
  42. pumpkin_api/wit_files/metadata.wit +15 -0
  43. pumpkin_api/wit_files/permission.wit +46 -0
  44. pumpkin_api/wit_files/player.wit +172 -0
  45. pumpkin_api/wit_files/plugin.wit +61 -0
  46. pumpkin_api/wit_files/poll_loop.py +440 -0
  47. pumpkin_api/wit_files/scheduler.wit +24 -0
  48. pumpkin_api/wit_files/scoreboard.wit +72 -0
  49. pumpkin_api/wit_files/server.wit +41 -0
  50. pumpkin_api/wit_files/text.wit +41 -0
  51. pumpkin_api/wit_files/wit_world/__init__.py +70 -0
  52. pumpkin_api/wit_files/wit_world/exports/__init__.py +19 -0
  53. pumpkin_api/wit_files/wit_world/exports/metadata.py +22 -0
  54. pumpkin_api/wit_files/wit_world/imports/__init__.py +0 -0
  55. pumpkin_api/wit_files/wit_world/imports/command.py +539 -0
  56. pumpkin_api/wit_files/wit_world/imports/common.py +213 -0
  57. pumpkin_api/wit_files/wit_world/imports/context.py +70 -0
  58. pumpkin_api/wit_files/wit_world/imports/entity.py +84 -0
  59. pumpkin_api/wit_files/wit_world/imports/event.py +434 -0
  60. pumpkin_api/wit_files/wit_world/imports/gui.py +61 -0
  61. pumpkin_api/wit_files/wit_world/imports/i18n.py +35 -0
  62. pumpkin_api/wit_files/wit_world/imports/logging.py +30 -0
  63. pumpkin_api/wit_files/wit_world/imports/permission.py +71 -0
  64. pumpkin_api/wit_files/wit_world/imports/player.py +350 -0
  65. pumpkin_api/wit_files/wit_world/imports/scheduler.py +44 -0
  66. pumpkin_api/wit_files/wit_world/imports/scoreboard.py +95 -0
  67. pumpkin_api/wit_files/wit_world/imports/server.py +75 -0
  68. pumpkin_api/wit_files/wit_world/imports/text.py +89 -0
  69. pumpkin_api/wit_files/wit_world/imports/world.py +215 -0
  70. pumpkin_api/wit_files/world.wit +169 -0
  71. pumpkin_api_py-0.1.0.dev0.dist-info/METADATA +58 -0
  72. pumpkin_api_py-0.1.0.dev0.dist-info/RECORD +75 -0
  73. pumpkin_api_py-0.1.0.dev0.dist-info/WHEEL +4 -0
  74. pumpkin_api_py-0.1.0.dev0.dist-info/entry_points.txt +2 -0
  75. pumpkin_api_py-0.1.0.dev0.dist-info/licenses/LICENSE +677 -0
@@ -0,0 +1,70 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from .imports import event
12
+ from .imports import server
13
+ from .imports import command
14
+ from .imports import context
15
+
16
+
17
+ class WitWorld(Protocol):
18
+
19
+ @abstractmethod
20
+ def init_plugin(self) -> None:
21
+ """
22
+ --- Plugin-provided exports ---
23
+ Called by the host once to initialize the plugin.
24
+ Internal use only; plugins should use the `register_plugin!` macro.
25
+ """
26
+ raise NotImplementedError
27
+
28
+ @abstractmethod
29
+ def on_load(self, context: context.Context) -> None:
30
+ """
31
+ Called when the plugin is being loaded.
32
+ Use this to register commands, events, and perform initial setup.
33
+
34
+ Raises: `componentize_py_types.Err(wit_world.imports.str)`
35
+ """
36
+ raise NotImplementedError
37
+
38
+ @abstractmethod
39
+ def on_unload(self, context: context.Context) -> None:
40
+ """
41
+ Called when the plugin is being unloaded.
42
+ Use this to save data and clean up resources.
43
+
44
+ Raises: `componentize_py_types.Err(wit_world.imports.str)`
45
+ """
46
+ raise NotImplementedError
47
+
48
+ @abstractmethod
49
+ def handle_event(self, event_id: int, server: server.Server, event: event.Event) -> event.Event:
50
+ """
51
+ Dispatches an event to the plugin for handling.
52
+ """
53
+ raise NotImplementedError
54
+
55
+ @abstractmethod
56
+ def handle_command(self, command_id: int, sender: command.CommandSender, server: server.Server, args: command.ConsumedArgs) -> int:
57
+ """
58
+ Dispatches a command execution to the plugin.
59
+
60
+ Raises: `componentize_py_types.Err(wit_world.imports.command.CommandError)`
61
+ """
62
+ raise NotImplementedError
63
+
64
+ @abstractmethod
65
+ def handle_task(self, handler_id: int, server: server.Server) -> None:
66
+ """
67
+ Dispatches a scheduled task execution to the plugin.
68
+ """
69
+ raise NotImplementedError
70
+
@@ -0,0 +1,19 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from ..exports import metadata
12
+
13
+ class Metadata(Protocol):
14
+
15
+ @abstractmethod
16
+ def get_metadata(self) -> metadata.PluginMetadata:
17
+ raise NotImplementedError
18
+
19
+
@@ -0,0 +1,22 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ """
4
+ Plugin metadata describing the plugin and its compatibility.
5
+ """
6
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
7
+ from types import TracebackType
8
+ from enum import Flag, Enum, auto
9
+ from dataclasses import dataclass
10
+ from abc import abstractmethod
11
+ import weakref
12
+
13
+ from componentize_py_types import Result, Ok, Err, Some
14
+
15
+
16
+ @dataclass
17
+ class PluginMetadata:
18
+ name: str
19
+ version: str
20
+ authors: List[str]
21
+ description: str
22
+
File without changes
@@ -0,0 +1,539 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from ..imports import common
12
+ from ..imports import entity
13
+ from ..imports import text
14
+ from ..imports import world
15
+ from ..imports import player
16
+ from ..imports import server
17
+
18
+ class Gamemode(Enum):
19
+ SURVIVAL = 0
20
+ CREATIVE = 1
21
+ ADVENTURE = 2
22
+ SPECTATOR = 3
23
+
24
+ class BossbarColor(Enum):
25
+ PINK = 0
26
+ BLUE = 1
27
+ RED = 2
28
+ GREEN = 3
29
+ YELLOW = 4
30
+ PURPLE = 5
31
+ WHITE = 6
32
+
33
+ class BossbarStyle(Enum):
34
+ NO_DIVISION = 0
35
+ NOTCHES6 = 1
36
+ NOTCHES10 = 2
37
+ NOTCHES12 = 3
38
+ NOTCHES20 = 4
39
+
40
+ class SoundCategory(Enum):
41
+ MASTER = 0
42
+ MUSIC = 1
43
+ RECORDS = 2
44
+ WEATHER = 3
45
+ BLOCKS = 4
46
+ HOSTILE = 5
47
+ NEUTRAL = 6
48
+ PLAYERS = 7
49
+ AMBIENT = 8
50
+ VOICE = 9
51
+ UI = 10
52
+
53
+ class EntityAnchor(Enum):
54
+ FEET = 0
55
+ EYES = 1
56
+
57
+
58
+ @dataclass
59
+ class Number_Float64:
60
+ value: float
61
+
62
+
63
+ @dataclass
64
+ class Number_Float32:
65
+ value: float
66
+
67
+
68
+ @dataclass
69
+ class Number_Int32:
70
+ value: int
71
+
72
+
73
+ @dataclass
74
+ class Number_Int64:
75
+ value: int
76
+
77
+
78
+ Number = Union[Number_Float64, Number_Float32, Number_Int32, Number_Int64]
79
+
80
+
81
+
82
+ @dataclass
83
+ class NotInBounds_LowerBound:
84
+ value: Tuple[Number, Number]
85
+
86
+
87
+ @dataclass
88
+ class NotInBounds_UpperBound:
89
+ value: Tuple[Number, Number]
90
+
91
+
92
+ NotInBounds = Union[NotInBounds_LowerBound, NotInBounds_UpperBound]
93
+
94
+
95
+
96
+ @dataclass
97
+ class Arg_Entities:
98
+ value: List[entity.Entity]
99
+
100
+
101
+ @dataclass
102
+ class Arg_Entity:
103
+ value: entity.Entity
104
+
105
+
106
+ @dataclass
107
+ class Arg_Players:
108
+ value: List[player.Player]
109
+
110
+
111
+ @dataclass
112
+ class Arg_BlockPos:
113
+ value: Tuple[int, int, int]
114
+
115
+
116
+ @dataclass
117
+ class Arg_Pos3d:
118
+ value: Tuple[float, float, float]
119
+
120
+
121
+ @dataclass
122
+ class Arg_Pos2d:
123
+ value: Tuple[float, float]
124
+
125
+
126
+ @dataclass
127
+ class Arg_Rotation:
128
+ value: Tuple[float, bool, float, bool]
129
+
130
+
131
+ @dataclass
132
+ class Arg_GameMode:
133
+ value: Gamemode
134
+
135
+
136
+ @dataclass
137
+ class Arg_Difficulty:
138
+ value: server.Difficulty
139
+
140
+
141
+ @dataclass
142
+ class Arg_Item:
143
+ value: str
144
+
145
+
146
+ @dataclass
147
+ class Arg_ItemPredicate:
148
+ value: str
149
+
150
+
151
+ @dataclass
152
+ class Arg_ResourceLocation:
153
+ value: str
154
+
155
+
156
+ @dataclass
157
+ class Arg_Block:
158
+ value: str
159
+
160
+
161
+ @dataclass
162
+ class Arg_BlockPredicate:
163
+ value: str
164
+
165
+
166
+ @dataclass
167
+ class Arg_BossbarColor:
168
+ value: BossbarColor
169
+
170
+
171
+ @dataclass
172
+ class Arg_BossbarStyle:
173
+ value: BossbarStyle
174
+
175
+
176
+ @dataclass
177
+ class Arg_Particle:
178
+ value: str
179
+
180
+
181
+ @dataclass
182
+ class Arg_Msg:
183
+ value: str
184
+
185
+
186
+ @dataclass
187
+ class Arg_TextComponent:
188
+ value: text.TextComponent
189
+
190
+
191
+ @dataclass
192
+ class Arg_Time:
193
+ value: int
194
+
195
+
196
+ @dataclass
197
+ class Arg_Num:
198
+ value: Result[Number, NotInBounds]
199
+
200
+
201
+ @dataclass
202
+ class Arg_Bool:
203
+ value: bool
204
+
205
+
206
+ @dataclass
207
+ class Arg_Simple:
208
+ value: str
209
+
210
+
211
+ @dataclass
212
+ class Arg_SoundCategory:
213
+ value: SoundCategory
214
+
215
+
216
+ @dataclass
217
+ class Arg_DamageType:
218
+ value: str
219
+
220
+
221
+ @dataclass
222
+ class Arg_Effect:
223
+ value: str
224
+
225
+
226
+ @dataclass
227
+ class Arg_Enchantment:
228
+ value: str
229
+
230
+
231
+ @dataclass
232
+ class Arg_EntityAnchor:
233
+ value: EntityAnchor
234
+
235
+
236
+ Arg = Union[Arg_Entities, Arg_Entity, Arg_Players, Arg_BlockPos, Arg_Pos3d, Arg_Pos2d, Arg_Rotation, Arg_GameMode, Arg_Difficulty, Arg_Item, Arg_ItemPredicate, Arg_ResourceLocation, Arg_Block, Arg_BlockPredicate, Arg_BossbarColor, Arg_BossbarStyle, Arg_Particle, Arg_Msg, Arg_TextComponent, Arg_Time, Arg_Num, Arg_Bool, Arg_Simple, Arg_SoundCategory, Arg_DamageType, Arg_Effect, Arg_Enchantment, Arg_EntityAnchor]
237
+
238
+
239
+ class ConsumedArgs:
240
+
241
+ def get_value(self, key: str) -> Arg:
242
+ raise NotImplementedError
243
+ def __enter__(self) -> Self:
244
+ """Returns self"""
245
+ return self
246
+
247
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
248
+ """
249
+ Release this resource.
250
+ """
251
+ raise NotImplementedError
252
+
253
+
254
+
255
+ @dataclass
256
+ class CommandSenderType_Rcon:
257
+ pass
258
+
259
+
260
+ @dataclass
261
+ class CommandSenderType_Console:
262
+ pass
263
+
264
+
265
+ @dataclass
266
+ class CommandSenderType_Player:
267
+ value: player.Player
268
+
269
+
270
+ @dataclass
271
+ class CommandSenderType_CommandBlock:
272
+ value: Tuple[entity.CommandBlockEntity, world.World]
273
+
274
+
275
+ @dataclass
276
+ class CommandSenderType_Dummy:
277
+ pass
278
+
279
+
280
+ CommandSenderType = Union[CommandSenderType_Rcon, CommandSenderType_Console, CommandSenderType_Player, CommandSenderType_CommandBlock, CommandSenderType_Dummy]
281
+
282
+
283
+ class PermissionLevel(Enum):
284
+ ZERO = 0
285
+ ONE = 1
286
+ TWO = 2
287
+ THREE = 3
288
+ FOUR = 4
289
+
290
+ class CommandSender:
291
+
292
+ def get_command_sender_type(self) -> CommandSenderType:
293
+ raise NotImplementedError
294
+ def send_message(self, text: text.TextComponent) -> None:
295
+ raise NotImplementedError
296
+ def set_success_count(self, count: int) -> None:
297
+ raise NotImplementedError
298
+ def is_player(self) -> bool:
299
+ raise NotImplementedError
300
+ def is_console(self) -> bool:
301
+ raise NotImplementedError
302
+ def as_player(self) -> Optional[player.Player]:
303
+ raise NotImplementedError
304
+ def permission_level(self) -> PermissionLevel:
305
+ raise NotImplementedError
306
+ def has_permission_level(self, level: PermissionLevel) -> bool:
307
+ raise NotImplementedError
308
+ def has_permission(self, server: server.Server, node: str) -> bool:
309
+ raise NotImplementedError
310
+ def position(self) -> Optional[Tuple[float, float, float]]:
311
+ raise NotImplementedError
312
+ def world(self) -> Optional[world.World]:
313
+ raise NotImplementedError
314
+ def get_locale(self) -> common.Locale:
315
+ raise NotImplementedError
316
+ def should_receive_feedback(self) -> bool:
317
+ raise NotImplementedError
318
+ def should_broadcast_console_to_ops(self) -> bool:
319
+ raise NotImplementedError
320
+ def should_track_output(self) -> bool:
321
+ raise NotImplementedError
322
+ def __enter__(self) -> Self:
323
+ """Returns self"""
324
+ return self
325
+
326
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
327
+ """
328
+ Release this resource.
329
+ """
330
+ raise NotImplementedError
331
+
332
+
333
+ class StringType(Enum):
334
+ SINGLE_WORD = 0
335
+ QUOTABLE = 1
336
+ GREEDY = 2
337
+
338
+
339
+ @dataclass
340
+ class ArgumentType_Bool:
341
+ pass
342
+
343
+
344
+ @dataclass
345
+ class ArgumentType_Float:
346
+ value: Tuple[Optional[float], Optional[float]]
347
+
348
+
349
+ @dataclass
350
+ class ArgumentType_Double:
351
+ value: Tuple[Optional[float], Optional[float]]
352
+
353
+
354
+ @dataclass
355
+ class ArgumentType_Integer:
356
+ value: Tuple[Optional[int], Optional[int]]
357
+
358
+
359
+ @dataclass
360
+ class ArgumentType_Long:
361
+ value: Tuple[Optional[int], Optional[int]]
362
+
363
+
364
+ @dataclass
365
+ class ArgumentType_String:
366
+ value: StringType
367
+
368
+
369
+ @dataclass
370
+ class ArgumentType_Entities:
371
+ pass
372
+
373
+
374
+ @dataclass
375
+ class ArgumentType_Entity:
376
+ pass
377
+
378
+
379
+ @dataclass
380
+ class ArgumentType_Players:
381
+ pass
382
+
383
+
384
+ @dataclass
385
+ class ArgumentType_GameProfile:
386
+ pass
387
+
388
+
389
+ @dataclass
390
+ class ArgumentType_BlockPos:
391
+ pass
392
+
393
+
394
+ @dataclass
395
+ class ArgumentType_Position3d:
396
+ pass
397
+
398
+
399
+ @dataclass
400
+ class ArgumentType_Position2d:
401
+ pass
402
+
403
+
404
+ @dataclass
405
+ class ArgumentType_BlockState:
406
+ pass
407
+
408
+
409
+ @dataclass
410
+ class ArgumentType_BlockPredicate:
411
+ pass
412
+
413
+
414
+ @dataclass
415
+ class ArgumentType_Item:
416
+ pass
417
+
418
+
419
+ @dataclass
420
+ class ArgumentType_ItemPredicate:
421
+ pass
422
+
423
+
424
+ @dataclass
425
+ class ArgumentType_Component:
426
+ pass
427
+
428
+
429
+ @dataclass
430
+ class ArgumentType_Rotation:
431
+ pass
432
+
433
+
434
+ @dataclass
435
+ class ArgumentType_ResourceLocation:
436
+ pass
437
+
438
+
439
+ @dataclass
440
+ class ArgumentType_EntityAnchor:
441
+ pass
442
+
443
+
444
+ @dataclass
445
+ class ArgumentType_Gamemode:
446
+ pass
447
+
448
+
449
+ @dataclass
450
+ class ArgumentType_Difficulty:
451
+ pass
452
+
453
+
454
+ @dataclass
455
+ class ArgumentType_Time:
456
+ value: int
457
+
458
+
459
+ @dataclass
460
+ class ArgumentType_Resource:
461
+ value: str
462
+
463
+
464
+ ArgumentType = Union[ArgumentType_Bool, ArgumentType_Float, ArgumentType_Double, ArgumentType_Integer, ArgumentType_Long, ArgumentType_String, ArgumentType_Entities, ArgumentType_Entity, ArgumentType_Players, ArgumentType_GameProfile, ArgumentType_BlockPos, ArgumentType_Position3d, ArgumentType_Position2d, ArgumentType_BlockState, ArgumentType_BlockPredicate, ArgumentType_Item, ArgumentType_ItemPredicate, ArgumentType_Component, ArgumentType_Rotation, ArgumentType_ResourceLocation, ArgumentType_EntityAnchor, ArgumentType_Gamemode, ArgumentType_Difficulty, ArgumentType_Time, ArgumentType_Resource]
465
+
466
+
467
+
468
+ @dataclass
469
+ class CommandError_InvalidConsumption:
470
+ value: Optional[str]
471
+
472
+
473
+ @dataclass
474
+ class CommandError_InvalidRequirement:
475
+ pass
476
+
477
+
478
+ @dataclass
479
+ class CommandError_PermissionDenied:
480
+ pass
481
+
482
+
483
+ @dataclass
484
+ class CommandError_CommandFailed:
485
+ value: text.TextComponent
486
+
487
+
488
+ CommandError = Union[CommandError_InvalidConsumption, CommandError_InvalidRequirement, CommandError_PermissionDenied, CommandError_CommandFailed]
489
+
490
+
491
+ class CommandNode:
492
+
493
+ @classmethod
494
+ def literal(cls, name: str) -> Self:
495
+ raise NotImplementedError
496
+ @classmethod
497
+ def argument(cls, name: str, arg_type: ArgumentType) -> Self:
498
+ raise NotImplementedError
499
+ def then(self, node: Self) -> None:
500
+ raise NotImplementedError
501
+ def execute_with_handler_id(self, handler_id: int) -> None:
502
+ raise NotImplementedError
503
+ def require_with_handler_id(self, handler_id: int) -> None:
504
+ raise NotImplementedError
505
+ def __enter__(self) -> Self:
506
+ """Returns self"""
507
+ return self
508
+
509
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
510
+ """
511
+ Release this resource.
512
+ """
513
+ raise NotImplementedError
514
+
515
+
516
+ class Command:
517
+
518
+ def __init__(self, names: List[str], description: str) -> None:
519
+ """
520
+ First name is primary, rest are aliases
521
+ """
522
+ raise NotImplementedError
523
+
524
+ def then(self, node: CommandNode) -> None:
525
+ raise NotImplementedError
526
+ def execute_with_handler_id(self, handler_id: int) -> None:
527
+ raise NotImplementedError
528
+ def __enter__(self) -> Self:
529
+ """Returns self"""
530
+ return self
531
+
532
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
533
+ """
534
+ Release this resource.
535
+ """
536
+ raise NotImplementedError
537
+
538
+
539
+