dshellInterpreter 0.2.13.2__tar.gz → 0.2.13.4__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.
Potentially problematic release.
This version of dshellInterpreter might be problematic. Click here for more details.
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_message.py +1 -1
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellInterpreteur/dshell_interpreter.py +7 -4
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellParser/ast_nodes.py +1 -2
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellParser/dshell_parser.py +2 -4
- {dshellinterpreter-0.2.13.2/dshellInterpreter.egg-info → dshellinterpreter-0.2.13.4}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4/dshellInterpreter.egg-info}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/setup.py +1 -1
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellParser/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/__init__.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_utils.py +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/LICENSE +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/README.md +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/setup.cfg +0 -0
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_message.py
RENAMED
|
@@ -45,7 +45,7 @@ async def dshell_send_message(ctx: Message, message=None, delete=None, channel=N
|
|
|
45
45
|
if isinstance(embeds, Embed):
|
|
46
46
|
embeds = ListNode([embeds])
|
|
47
47
|
|
|
48
|
-
if not isinstance(
|
|
48
|
+
if not isinstance(view, (EasyModifiedViews, NoneType)):
|
|
49
49
|
raise Exception(f'Channel must be an UI or None, not {type(channel_to_send)} !')
|
|
50
50
|
|
|
51
51
|
sended_message = await channel_to_send.send(message,
|
|
@@ -311,7 +311,7 @@ async def call_function(function: Callable, args: ArgsCommandNode, interpreter:
|
|
|
311
311
|
return await function(*absolute_args, **keyword_args)
|
|
312
312
|
|
|
313
313
|
|
|
314
|
-
def regroupe_commandes(body: list[Token], interpreter: DshellInterpreteur) -> list[dict[str, list[Any]]]:
|
|
314
|
+
def regroupe_commandes(body: list[Token], interpreter: DshellInterpreteur, normalise: bool = False) -> list[dict[str, list[Any]]]:
|
|
315
315
|
"""
|
|
316
316
|
Groups the command arguments in the form of a python dictionary.
|
|
317
317
|
Note that you can specify the parameter you wish to pass via -- followed by the parameter name. But this is not mandatory!
|
|
@@ -322,6 +322,7 @@ def regroupe_commandes(body: list[Token], interpreter: DshellInterpreteur) -> li
|
|
|
322
322
|
|
|
323
323
|
:param body: The list of tokens to group.
|
|
324
324
|
:param interpreter: The Dshell interpreter instance.
|
|
325
|
+
:param normalise: If True, normalises the arguments (make value lowercase).
|
|
325
326
|
"""
|
|
326
327
|
tokens = {'*': [],
|
|
327
328
|
'--*': {}} # tokens to return
|
|
@@ -332,6 +333,9 @@ def regroupe_commandes(body: list[Token], interpreter: DshellInterpreteur) -> li
|
|
|
332
333
|
i = 0
|
|
333
334
|
while i < n:
|
|
334
335
|
|
|
336
|
+
if normalise and body[i].type == DTT.STR:
|
|
337
|
+
body[i].value = body[i].value.lower()
|
|
338
|
+
|
|
335
339
|
if body[i].type == DTT.SEPARATOR and body[
|
|
336
340
|
i + 1].type == DTT.IDENT: # Check if it's a separator and if the next token is an IDENT
|
|
337
341
|
current_arg = body[i + 1].value # change the current argument. It will be impossible to return to '*'
|
|
@@ -419,12 +423,11 @@ def build_ui(ui_node: UiNode, interpreter: DshellInterpreteur) -> EasyModifiedVi
|
|
|
419
423
|
view = EasyModifiedViews()
|
|
420
424
|
|
|
421
425
|
for component in ui_node.buttons:
|
|
422
|
-
|
|
423
|
-
args_button: dict[str, list[Any]] = regroupe_commandes(component.body, interpreter)[0]
|
|
426
|
+
args_button: dict[str, list[Any]] = regroupe_commandes(component.body, interpreter, normalise=True)[0]
|
|
424
427
|
args_button.pop('--*', ())
|
|
425
428
|
code = args_button.pop('code', None)
|
|
426
429
|
args = args_button.pop('*', ())
|
|
427
|
-
b(*args, **args_button)
|
|
430
|
+
b = Button(*args, **args_button)
|
|
428
431
|
|
|
429
432
|
custom_id = ''.join(choice(ascii_letters + digits) for _ in range(20))
|
|
430
433
|
b.custom_id = custom_id
|
|
@@ -498,12 +498,11 @@ class UiNode(ASTNode):
|
|
|
498
498
|
This is used to define UI elements for commands in Dshell.
|
|
499
499
|
"""
|
|
500
500
|
|
|
501
|
-
def __init__(self,
|
|
501
|
+
def __init__(self, buttons: Optional[list[UiButtonNode]] = None,
|
|
502
502
|
selects: Optional[list[UiSelectNode]] = None):
|
|
503
503
|
"""
|
|
504
504
|
:param body: list of tokens representing the UI component
|
|
505
505
|
"""
|
|
506
|
-
self.body = body
|
|
507
506
|
self.buttons = buttons or []
|
|
508
507
|
self.selects = selects or []
|
|
509
508
|
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellParser/dshell_parser.py
RENAMED
|
@@ -205,15 +205,13 @@ def parse(token_lines: list[list[Token]], start_node: ASTNode) -> tuple[list[AST
|
|
|
205
205
|
if not isinstance(last_block, UiNode):
|
|
206
206
|
raise SyntaxError(f'[BUTTON] No UI open on line {first_token_line.position} !')
|
|
207
207
|
button_node = UiButtonNode(tokens_by_line[1:])
|
|
208
|
-
last_block.
|
|
209
|
-
pointeur += 1
|
|
208
|
+
last_block.buttons.append(button_node)
|
|
210
209
|
|
|
211
210
|
elif first_token_line.value == 'select':
|
|
212
211
|
if not isinstance(last_block, UiNode):
|
|
213
212
|
raise SyntaxError(f'[SELECT] No UI open on line {first_token_line.position} !')
|
|
214
213
|
select_node = UiSelectNode(tokens_by_line[1:])
|
|
215
|
-
last_block.
|
|
216
|
-
pointeur += 1
|
|
214
|
+
last_block.selects.append(select_node)
|
|
217
215
|
|
|
218
216
|
############################## AUTRE ##############################
|
|
219
217
|
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="0.2.13.
|
|
8
|
+
version="0.2.13.4",
|
|
9
9
|
author="Chronos",
|
|
10
10
|
author_email="vagabonwalybi@gmail.com",
|
|
11
11
|
description="A Discord bot interpreter for creating custom commands and automations.",
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_channel.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/DISCORD_COMMANDS/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/Dshell/_DshellTokenizer/dshell_keywords.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.2 → dshellinterpreter-0.2.13.4}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|