dshellInterpreter 1.2.0.5__tar.gz → 1.2.0.7__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.
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_file.py +1 -1
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/dshell_interpreter.py +10 -10
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellParser/ast_nodes.py +20 -3
- dshellinterpreter-1.2.0.7/Dshell/DshellParser/errors.py +8 -0
- {dshellinterpreter-1.2.0.5/dshellInterpreter.egg-info → dshellinterpreter-1.2.0.7}/PKG-INFO +1 -1
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7/dshellInterpreter.egg-info}/PKG-INFO +1 -1
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/SOURCES.txt +1 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/setup.py +1 -1
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_embed.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_ui.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_file.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_global.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_list.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_member.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_numbers.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_string.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_type_validation.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/cached_messages.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/dshell_arguments.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/dshell_global_variables.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/dshell_scope.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/errors.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/utils_interpreter.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellParser/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellParser/dshell_parser.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellPreProcess/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellPreProcess/dshell_preprocess.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_tokenizer.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/__init__.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/full_import.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/regex_test.py +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/LICENSE +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/README.md +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/setup.cfg +0 -0
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_file.py
RENAMED
|
@@ -25,7 +25,7 @@ async def dshell_get_message_files(ctx: Message, message: Union[StrNode, IntNode
|
|
|
25
25
|
|
|
26
26
|
target_message = ctx if message is None else utils_get_message(ctx, message)
|
|
27
27
|
|
|
28
|
-
attachments_list: ListNode = ListNode([])
|
|
28
|
+
attachments_list: ListNode = ListNode([], bypass_limit_elt=True)
|
|
29
29
|
|
|
30
30
|
if isinstance(target_message, PartialMessage):
|
|
31
31
|
target_message = await target_message.fetch()
|
|
@@ -71,7 +71,7 @@ class DshellInterpreteur:
|
|
|
71
71
|
'__message_before__': StrNode(message.content), # same as __message__, but before edit. Can be overwritten by add vars_env parameter
|
|
72
72
|
'__message_created_at__': StrNode(message.created_at),
|
|
73
73
|
'__message_edited_at__': StrNode(message.edited_at),
|
|
74
|
-
'__message_reactions__': ListNode([StrNode(reaction.emoji) for reaction in message.reactions], bypass_limit_elt=True),
|
|
74
|
+
'__message_reactions__': ListNode([StrNode(reaction.emoji) for reaction in message.reactions], bypass_limit_elt=True, editable=False),
|
|
75
75
|
'__message_add_reaction__': None, # Can be overwritten by add vars_env parameter to get the reaction added on message add event reaction
|
|
76
76
|
'__message_remove_reaction__': None, # Can be overwritten by add vars_env parameter to get the reaction removed on message remove event reaction
|
|
77
77
|
'__message_url__': StrNode(message.jump_url) if hasattr(message, 'jump_url') else None,
|
|
@@ -86,21 +86,21 @@ class DshellInterpreteur:
|
|
|
86
86
|
'__guild__': IntNode(message.channel.guild.id),
|
|
87
87
|
'__guild_name__': StrNode(message.channel.guild.name),
|
|
88
88
|
'__guild_id__': IntNode(message.channel.guild.id),
|
|
89
|
-
'__guild_members__': ListNode([IntNode(member.id) for member in message.channel.guild.members], bypass_limit_elt=True),
|
|
89
|
+
'__guild_members__': ListNode([IntNode(member.id) for member in message.channel.guild.members], bypass_limit_elt=True, editable=False),
|
|
90
90
|
'__guild_member_count__': IntNode(message.channel.guild.member_count),
|
|
91
91
|
'__guild_icon__': StrNode(message.channel.guild.icon.url) if message.channel.guild.icon else None,
|
|
92
92
|
'__guild_owner_id__': IntNode(message.channel.guild.owner_id),
|
|
93
93
|
'__guild_description__': StrNode(message.channel.guild.description),
|
|
94
|
-
'__guild_roles__': ListNode([IntNode(role.id) for role in message.channel.guild.roles], bypass_limit_elt=True),
|
|
94
|
+
'__guild_roles__': ListNode([IntNode(role.id) for role in message.channel.guild.roles], bypass_limit_elt=True, editable=False),
|
|
95
95
|
'__guild_roles_count__': IntNode(len(message.channel.guild.roles)),
|
|
96
|
-
'__guild_emojis__': ListNode([IntNode(emoji.id) for emoji in message.channel.guild.emojis], bypass_limit_elt=True),
|
|
96
|
+
'__guild_emojis__': ListNode([IntNode(emoji.id) for emoji in message.channel.guild.emojis], bypass_limit_elt=True, editable=False),
|
|
97
97
|
'__guild_emojis_count__': IntNode(len(message.channel.guild.emojis)),
|
|
98
|
-
'__guild_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.channels], bypass_limit_elt=True),
|
|
99
|
-
'__guild_text_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.text_channels], bypass_limit_elt=True),
|
|
100
|
-
'__guild_voice_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.voice_channels], bypass_limit_elt=True),
|
|
101
|
-
'__guild_categories__': ListNode([IntNode(channel.id) for channel in message.channel.guild.categories], bypass_limit_elt=True),
|
|
102
|
-
'__guild_stage_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.stage_channels], bypass_limit_elt=True),
|
|
103
|
-
'__guild_forum_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.forum_channels], bypass_limit_elt=True),
|
|
98
|
+
'__guild_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.channels], bypass_limit_elt=True, editable=False),
|
|
99
|
+
'__guild_text_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.text_channels], bypass_limit_elt=True, editable=False),
|
|
100
|
+
'__guild_voice_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.voice_channels], bypass_limit_elt=True, editable=False),
|
|
101
|
+
'__guild_categories__': ListNode([IntNode(channel.id) for channel in message.channel.guild.categories], bypass_limit_elt=True, editable=False),
|
|
102
|
+
'__guild_stage_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.stage_channels], bypass_limit_elt=True, editable=False),
|
|
103
|
+
'__guild_forum_channels__': ListNode([IntNode(channel.id) for channel in message.channel.guild.forum_channels], bypass_limit_elt=True, editable=False),
|
|
104
104
|
'__guild_channels_count__': IntNode(len(message.channel.guild.channels)),
|
|
105
105
|
|
|
106
106
|
} if message is not None and not debug else {'__ret__': None}) # {} is used in debug mode, when ctx is None
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from Dshell.full_import import (Any, randint, Optional, Union, Embed, Member, Role, PermissionOverwrite)
|
|
2
2
|
from ..DshellTokenizer.dshell_token_type import Token
|
|
3
3
|
from ..DshellInterpreteur.dshell_global_variables import MAX_STR_SIZE, MAX_LIST_SIZE, MAX_FILE_SIZE
|
|
4
|
+
from .errors import *
|
|
4
5
|
|
|
5
6
|
from sys import getsizeof
|
|
6
7
|
|
|
@@ -876,7 +877,7 @@ class ListNode(ASTNode):
|
|
|
876
877
|
This class also lets you interact with the list via specific methods not built in by python.
|
|
877
878
|
"""
|
|
878
879
|
|
|
879
|
-
def __init__(self, body: list[Any], bypass_limit_elt: bool = False):
|
|
880
|
+
def __init__(self, body: list[Any], bypass_limit_elt: bool = False, editable: bool = True):
|
|
880
881
|
"""
|
|
881
882
|
:param body: list of elements to initialize the ListNode with
|
|
882
883
|
"""
|
|
@@ -886,8 +887,9 @@ class ListNode(ASTNode):
|
|
|
886
887
|
self.iterator_count: int = 0
|
|
887
888
|
self.size: int = 0
|
|
888
889
|
self.bypass_limit_elt: bool = bypass_limit_elt
|
|
890
|
+
self.editable: bool = editable
|
|
889
891
|
for i in body:
|
|
890
|
-
self.add(i)
|
|
892
|
+
self.add(i, init=True)
|
|
891
893
|
|
|
892
894
|
def to_dict(self):
|
|
893
895
|
"""
|
|
@@ -915,10 +917,13 @@ class ListNode(ASTNode):
|
|
|
915
917
|
"""
|
|
916
918
|
self.size -= getsizeof(value)
|
|
917
919
|
|
|
918
|
-
def add(self, value: Any):
|
|
920
|
+
def add(self, value: Any, init: bool = False):
|
|
919
921
|
"""
|
|
920
922
|
Add a value to the list.
|
|
921
923
|
"""
|
|
924
|
+
if not init and not self.editable:
|
|
925
|
+
raise ListNotEditableError()
|
|
926
|
+
|
|
922
927
|
if not self.bypass_limit_elt and self.len_iterable > 1000:
|
|
923
928
|
raise PermissionError('The list is too long, it must not exceed 1000 elements !')
|
|
924
929
|
|
|
@@ -933,6 +938,9 @@ class ListNode(ASTNode):
|
|
|
933
938
|
"""
|
|
934
939
|
Remove a value from the list.
|
|
935
940
|
"""
|
|
941
|
+
if not self.editable:
|
|
942
|
+
raise ListNotEditableError()
|
|
943
|
+
|
|
936
944
|
if number < 1:
|
|
937
945
|
raise Exception(f"The number of elements to remove must be at least 1, not {number} !")
|
|
938
946
|
|
|
@@ -951,6 +959,9 @@ class ListNode(ASTNode):
|
|
|
951
959
|
Remove and return the last element of the list.
|
|
952
960
|
:return: The last element of the list.
|
|
953
961
|
"""
|
|
962
|
+
if not self.editable:
|
|
963
|
+
raise ListNotEditableError()
|
|
964
|
+
|
|
954
965
|
if self.len_iterable == 0:
|
|
955
966
|
raise IndexError("pop from empty list")
|
|
956
967
|
if 0 > index >= self.len_iterable or -self.len_iterable > index < 0:
|
|
@@ -966,6 +977,9 @@ class ListNode(ASTNode):
|
|
|
966
977
|
:param index: The index at which to set the value.
|
|
967
978
|
:param value: The value to set at the specified index.
|
|
968
979
|
"""
|
|
980
|
+
if not self.editable:
|
|
981
|
+
raise ListNotEditableError()
|
|
982
|
+
|
|
969
983
|
if 0 > index >= self.len_iterable or -self.len_iterable > index < 0:
|
|
970
984
|
raise IndexError("set index out of range")
|
|
971
985
|
|
|
@@ -984,6 +998,9 @@ class ListNode(ASTNode):
|
|
|
984
998
|
"""
|
|
985
999
|
Clear the list.
|
|
986
1000
|
"""
|
|
1001
|
+
if not self.editable:
|
|
1002
|
+
raise ListNotEditableError()
|
|
1003
|
+
|
|
987
1004
|
self.iterable = []
|
|
988
1005
|
self.len_iterable = 0
|
|
989
1006
|
self.iterator_count = 0
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
@@ -37,6 +37,7 @@ Dshell/DshellInterpreteur/utils_interpreter.py
|
|
|
37
37
|
Dshell/DshellParser/__init__.py
|
|
38
38
|
Dshell/DshellParser/ast_nodes.py
|
|
39
39
|
Dshell/DshellParser/dshell_parser.py
|
|
40
|
+
Dshell/DshellParser/errors.py
|
|
40
41
|
Dshell/DshellPreProcess/__init__.py
|
|
41
42
|
Dshell/DshellPreProcess/dshell_preprocess.py
|
|
42
43
|
Dshell/DshellTokenizer/__init__.py
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="1.2.0.
|
|
8
|
+
version="1.2.0.7",
|
|
9
9
|
author="Chronos",
|
|
10
10
|
author_email="vagabonwalybi@gmail.com",
|
|
11
11
|
description="A Discord bot interpreter for creating custom commands and automations.",
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_channel.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_embed.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_message.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/dshell_ui.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DISCORD_COMMANDS/utils/utils_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/cached_messages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellInterpreteur/dshell_scope.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellParser/dshell_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellPreProcess/dshell_preprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_keywords.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_token_type.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/Dshell/DshellTokenizer/dshell_tokenizer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.0.5 → dshellinterpreter-1.2.0.7}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|