dshellInterpreter 1.2.7.5__tar.gz → 1.2.7.6__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.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_file.py +1 -4
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/ast_nodes.py +24 -33
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_tokenizer.py +1 -1
- {dshellinterpreter-1.2.7.5/dshellInterpreter.egg-info → dshellinterpreter-1.2.7.6}/PKG-INFO +1 -1
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6/dshellInterpreter.egg-info}/PKG-INFO +1 -1
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/setup.py +1 -1
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_embed.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_ui.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_file.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_global.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_list.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_member.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_numbers.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_string.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_type_validation.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/cached_messages.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_arguments.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_global_variables.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_interpreter.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_iterators.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_scope.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/errors.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/utils_interpreter.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/dshell_parser.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/errors.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/dshell_preprocess.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/__init__.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/full_import.py +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/LICENSE +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/README.md +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/setup.cfg +0 -0
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_file.py
RENAMED
|
@@ -27,9 +27,6 @@ async def dshell_get_message_files(ctx: Message, message: Union[StrNode, IntNode
|
|
|
27
27
|
|
|
28
28
|
attachments_list: ListNode = ListNode([], bypass_limit_elt=True)
|
|
29
29
|
|
|
30
|
-
if isinstance(target_message, PartialMessage):
|
|
31
|
-
target_message = await target_message.fetch()
|
|
32
|
-
|
|
33
30
|
for attachment in target_message.attachments:
|
|
34
31
|
if attachment.content_type is not None and attachment.content_type.startswith("text/"):
|
|
35
32
|
file = FileNode(name=attachment.filename,
|
|
@@ -91,7 +88,7 @@ async def dshell_write_file(ctx: Message,
|
|
|
91
88
|
_validate_required_bool(append, 'append', 'wf')
|
|
92
89
|
_validate_optional_string(filename, 'filename', 'wf')
|
|
93
90
|
|
|
94
|
-
target_file = file if isinstance(file, FileNode) else FileNode(filename if filename is not None else "unnamed_file.txt")
|
|
91
|
+
target_file = file if isinstance(file, FileNode) else FileNode(filename if filename is not None else StrNode("unnamed_file.txt"))
|
|
95
92
|
|
|
96
93
|
target_file.description = description if description is not None else target_file.description
|
|
97
94
|
target_file.spoiler = spoiler if spoiler is not None else target_file.spoiler
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
from Dshell.full_import import (
|
|
1
|
+
from Dshell.full_import import (
|
|
2
|
+
Any,
|
|
3
|
+
randint,
|
|
4
|
+
Optional,
|
|
5
|
+
Union,
|
|
6
|
+
Embed,
|
|
7
|
+
Member,
|
|
8
|
+
Role,
|
|
9
|
+
PermissionOverwrite,
|
|
10
|
+
getsizeof,
|
|
11
|
+
Invite)
|
|
2
12
|
from ..DshellTokenizer.dshell_token_type import Token
|
|
3
13
|
from ..DshellInterpreteur.dshell_global_variables import MAX_STR_SIZE, MAX_LIST_SIZE, MAX_FILE_SIZE
|
|
4
14
|
from .errors import *
|
|
@@ -9,7 +19,6 @@ __all__ = [
|
|
|
9
19
|
'IntNode',
|
|
10
20
|
'FloatNode',
|
|
11
21
|
'BoolNode',
|
|
12
|
-
'LengthNode',
|
|
13
22
|
'StartNode',
|
|
14
23
|
'ElseNode',
|
|
15
24
|
'ElifNode',
|
|
@@ -52,8 +61,13 @@ class ASTNode:
|
|
|
52
61
|
def __getattr__(self, item):
|
|
53
62
|
raise AttributeError(f"'{type(self).__name__}' node has no attribute '{item}'")
|
|
54
63
|
|
|
64
|
+
class DATANode:
|
|
65
|
+
"""
|
|
66
|
+
Base class for all Data nodes created during execution
|
|
67
|
+
"""
|
|
68
|
+
|
|
55
69
|
|
|
56
|
-
class StrNode(str, ASTNode):
|
|
70
|
+
class StrNode(str, ASTNode, DATANode):
|
|
57
71
|
|
|
58
72
|
def __new__(cls, value: Any):
|
|
59
73
|
cls.pointer = 0
|
|
@@ -115,7 +129,7 @@ class StrNode(str, ASTNode):
|
|
|
115
129
|
def __repr__(self):
|
|
116
130
|
return StrNode(f"{super().__repr__()}")
|
|
117
131
|
|
|
118
|
-
class IntNode(int, ASTNode):
|
|
132
|
+
class IntNode(int, ASTNode, DATANode):
|
|
119
133
|
def __new__(cls, value: Union[str, StrNode, int, "IntNode", float, "FloatNode"], base: int = 10):
|
|
120
134
|
if isinstance(value, (int, IntNode, float, FloatNode)):
|
|
121
135
|
return super().__new__(cls, value)
|
|
@@ -127,7 +141,7 @@ class IntNode(int, ASTNode):
|
|
|
127
141
|
def __sizeof__(self):
|
|
128
142
|
return getsizeof(IntNode)
|
|
129
143
|
|
|
130
|
-
class FloatNode(float, ASTNode):
|
|
144
|
+
class FloatNode(float, ASTNode, DATANode):
|
|
131
145
|
def __new__(cls, value: Union[str, StrNode, float, "FloatNode", int, IntNode]):
|
|
132
146
|
return super().__new__(cls, value)
|
|
133
147
|
|
|
@@ -137,7 +151,7 @@ class FloatNode(float, ASTNode):
|
|
|
137
151
|
def __sizeof__(self):
|
|
138
152
|
return getsizeof(FloatNode)
|
|
139
153
|
|
|
140
|
-
class BoolNode(int, ASTNode):
|
|
154
|
+
class BoolNode(int, ASTNode, DATANode):
|
|
141
155
|
def __new__(cls, value: Union[str, StrNode, int, IntNode, bool, "BoolNode"]):
|
|
142
156
|
return super().__new__(cls, int(bool(value)))
|
|
143
157
|
|
|
@@ -396,30 +410,6 @@ class VarNode(ASTNode):
|
|
|
396
410
|
"body": [token.to_dict() for token in self.body]
|
|
397
411
|
}
|
|
398
412
|
|
|
399
|
-
class LengthNode(ASTNode):
|
|
400
|
-
"""
|
|
401
|
-
Node representing the length operation in the AST.
|
|
402
|
-
"""
|
|
403
|
-
|
|
404
|
-
def __init__(self, body: Token, line: int):
|
|
405
|
-
"""
|
|
406
|
-
:param body: list of tokens representing the body of the length operation
|
|
407
|
-
"""
|
|
408
|
-
super().__init__(line)
|
|
409
|
-
self.body = body
|
|
410
|
-
|
|
411
|
-
def __repr__(self):
|
|
412
|
-
return StrNode(f"<LENGTH> - {self.body}")
|
|
413
|
-
|
|
414
|
-
def to_dict(self):
|
|
415
|
-
"""
|
|
416
|
-
Convert the LengthNode to a dictionary representation.
|
|
417
|
-
:return: Dictionary representation of the LengthNode.
|
|
418
|
-
"""
|
|
419
|
-
return {
|
|
420
|
-
"type": "LengthNode",
|
|
421
|
-
"body": self.body.to_dict()
|
|
422
|
-
}
|
|
423
413
|
|
|
424
414
|
class EndNode(ASTNode):
|
|
425
415
|
"""
|
|
@@ -558,6 +548,7 @@ class PermissionNode(ASTNode):
|
|
|
558
548
|
def __repr__(self):
|
|
559
549
|
return StrNode(f"<PERMISSION> - {self.value}")
|
|
560
550
|
|
|
551
|
+
|
|
561
552
|
class SleepNode(ASTNode):
|
|
562
553
|
"""
|
|
563
554
|
Node representing a sleep command in the AST.
|
|
@@ -841,7 +832,7 @@ class OptionUiSelectNode(ASTNode):
|
|
|
841
832
|
"body": [token.to_dict() for token in self.body]
|
|
842
833
|
}
|
|
843
834
|
|
|
844
|
-
class FileNode(
|
|
835
|
+
class FileNode(DATANode):
|
|
845
836
|
def __init__(self, name: Optional[StrNode] = None, description: Optional[StrNode] = None, spoiler: bool = False):
|
|
846
837
|
super().__init__(0)
|
|
847
838
|
self.name = name
|
|
@@ -877,7 +868,7 @@ class FileNode(ASTNode):
|
|
|
877
868
|
def __repr__(self):
|
|
878
869
|
return StrNode(f"<FILE> - {self.name}")
|
|
879
870
|
|
|
880
|
-
class FileStreamNode(
|
|
871
|
+
class FileStreamNode(DATANode):
|
|
881
872
|
|
|
882
873
|
def __init__(self, file: FileNode, separator: Optional[StrNode] = None):
|
|
883
874
|
super().__init__(-1)
|
|
@@ -927,7 +918,7 @@ class FileStreamNode(ASTNode):
|
|
|
927
918
|
return self.file.size()
|
|
928
919
|
|
|
929
920
|
|
|
930
|
-
class ListNode(ASTNode):
|
|
921
|
+
class ListNode(ASTNode, DATANode):
|
|
931
922
|
"""
|
|
932
923
|
Node representing a list structure in the AST.
|
|
933
924
|
Iterable class for browsing lists created from Dshell code.
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_tokenizer.py
RENAMED
|
@@ -115,7 +115,7 @@ class DshellTokenizer:
|
|
|
115
115
|
tokens_per_line.append(token)
|
|
116
116
|
|
|
117
117
|
if token_type == DTT.STR:
|
|
118
|
-
token.value = sub(backslash_pattern,
|
|
118
|
+
token.value = sub(backslash_pattern, r"\1", token.value)
|
|
119
119
|
|
|
120
120
|
len_match = len(match.group(0))
|
|
121
121
|
line = line[:start_match] + MASK_CHARACTER * len_match + line[end_match:]
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="1.2.7.
|
|
8
|
+
version="1.2.7.6",
|
|
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.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_channel.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_embed.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_message.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_ui.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/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.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/cached_messages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_scope.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/dshell_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/dshell_preprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_keywords.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_token_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.5 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|