dshellInterpreter 1.1.3.2__tar.gz → 1.1.3.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.
Files changed (48) hide show
  1. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_member.py +3 -1
  2. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_list.py +37 -3
  3. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellTokenizer/dshell_keywords.py +2 -0
  4. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellTokenizer/dshell_tokenizer.py +10 -6
  5. {dshellinterpreter-1.1.3.2/dshellInterpreter.egg-info → dshellinterpreter-1.1.3.4}/PKG-INFO +1 -1
  6. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4/dshellInterpreter.egg-info}/PKG-INFO +1 -1
  7. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/setup.py +1 -1
  8. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  9. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
  10. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_embed.py +0 -0
  11. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
  12. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
  13. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
  14. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
  15. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/dshell_ui.py +0 -0
  16. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
  17. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_global.py +0 -0
  18. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_member.py +0 -0
  19. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
  20. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_numbers.py +0 -0
  21. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +0 -0
  22. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_string.py +0 -0
  23. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
  24. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DISCORD_COMMANDS/utils/utils_type_validation.py +0 -0
  25. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/__init__.py +0 -0
  26. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/cached_messages.py +0 -0
  27. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/dshell_arguments.py +0 -0
  28. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/dshell_interpreter.py +0 -0
  29. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/dshell_scope.py +0 -0
  30. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/errors.py +0 -0
  31. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellInterpreteur/utils_interpreter.py +0 -0
  32. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellParser/__init__.py +0 -0
  33. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellParser/ast_nodes.py +0 -0
  34. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellParser/dshell_parser.py +0 -0
  35. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellPreProcess/__init__.py +0 -0
  36. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellPreProcess/dshell_preprocess.py +0 -0
  37. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellTokenizer/__init__.py +0 -0
  38. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/DshellTokenizer/dshell_token_type.py +0 -0
  39. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/__init__.py +0 -0
  40. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/full_import.py +0 -0
  41. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/Dshell/regex_test.py +0 -0
  42. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/LICENSE +0 -0
  43. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/README.md +0 -0
  44. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  45. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  46. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/dshellInterpreter.egg-info/requires.txt +0 -0
  47. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/dshellInterpreter.egg-info/top_level.txt +0 -0
  48. {dshellinterpreter-1.1.3.2 → dshellinterpreter-1.1.3.4}/setup.cfg +0 -0
@@ -1,3 +1,5 @@
1
+ from discord import VoiceChannel
2
+
1
3
  from Dshell.full_import import (Message,
2
4
  Embed,
3
5
  MISSING,
@@ -338,7 +340,7 @@ async def dshell_check_permissions(ctx: Message, permissions, member=None):
338
340
  return False
339
341
 
340
342
 
341
- async def dshell_move_member(ctx: Message, member=None, channel=None, disconnect: bool = False, reason=None):
343
+ async def dshell_move_member(ctx: Message, channel=None, member=None, disconnect: bool = False, reason=None):
342
344
  """
343
345
  Déplace un membre vers un autre canal vocal ou le déconnecte.
344
346
 
@@ -1,4 +1,5 @@
1
1
  __all__ = [
2
+ "utils_convert_to_list",
2
3
  "utils_list_add",
3
4
  "utils_list_remove",
4
5
  "utils_list_clear",
@@ -9,11 +10,44 @@ __all__ = [
9
10
  "utils_list_get_value",
10
11
  ]
11
12
 
12
- from ...DshellParser.ast_nodes import ListNode
13
-
13
+ from ...DshellParser.ast_nodes import ListNode, UiButtonNode, UiSelectNode, CodeNode
14
+ from ...full_import import Any, Union
14
15
  from .utils_type_validation import (_validate_required_list_node,
15
16
  _validate_required_int,
16
- _validate_required_bool)
17
+ _validate_required_bool,
18
+ _validate_optional_bool)
19
+
20
+ async def utils_convert_to_list(ctx,
21
+ value: Union[str, int, float, UiButtonNode, UiSelectNode, CodeNode],
22
+ split: bool = False):
23
+ """
24
+ Make a list with any value
25
+ :param ctx:
26
+ :param value:
27
+ :param split: split the value into list
28
+ :return:
29
+ """
30
+ _CMD = 'list'
31
+ _validate_optional_bool(split, "split", _CMD)
32
+
33
+ if isinstance(value, str):
34
+ if split:
35
+ return ListNode([i for i in value])
36
+ return ListNode([value])
37
+
38
+ elif isinstance(value, int):
39
+ if split:
40
+ l = ListNode([])
41
+ while value != 0:
42
+ l.add(value % 10)
43
+ value //= 10
44
+ return l
45
+ return ListNode([value])
46
+
47
+ else:
48
+ return ListNode([value])
49
+
50
+
17
51
 
18
52
  async def utils_list_add(ctx, value: ListNode, *elements):
19
53
  """
@@ -38,6 +38,7 @@ dshell_commands: dict[str, Callable] = {
38
38
  'random': utils_random,
39
39
 
40
40
  ## List utils
41
+ 'list': utils_convert_to_list,
41
42
  'length': utils_len,
42
43
  'len': utils_len,
43
44
  'add': utils_list_add,
@@ -185,6 +186,7 @@ dshell_logical_word_operators: dict[str, tuple[Callable, int, int]] = {
185
186
 
186
187
  dshell_logical_operators: dict[str, tuple[Callable, int, int]] = {
187
188
 
189
+ r"==": (lambda a, b: a == b, 4, 2),
188
190
  r"<=": (lambda a, b: a <= b, 4, 2),
189
191
  r"=<": (lambda a, b: a <= b, 4, 2),
190
192
  r"!=": (lambda a, b: a != b, 4, 2),
@@ -113,21 +113,25 @@ class DshellTokenizer:
113
113
 
114
114
  for token_type, pattern in table_regex.items(): # iterate the regex table to test all patterns on the line
115
115
 
116
+ if is_comment:
117
+ is_comment = False
118
+ break
119
+
116
120
  if is_line_empty(line):
117
121
  break
118
122
 
119
123
  if not self.match_any_character and token_type == DTT.ANY_CHARACTER:
120
124
  continue
121
125
 
122
- if is_comment:
123
- is_comment = False
124
- break
125
-
126
126
  for match in finditer(pattern, line): # iterate the match results to get their positions
127
127
 
128
128
  if token_type == DTT.COMMENT: # if we encounter a comment, stop tokenizing the line
129
- is_comment = True
130
- break
129
+ if len(match.group(0)) == len(line):
130
+ is_comment = True
131
+ break
132
+ else:
133
+ line = line[:match.start()]
134
+ continue
131
135
 
132
136
  start_match = match.start() # start position of the match
133
137
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 1.1.3.2
3
+ Version: 1.1.3.4
4
4
  Summary: A Discord bot interpreter for creating custom commands and automations.
5
5
  Home-page: https://github.com/BOXERRMD/Dshell_Interpreter
6
6
  Author: Chronos
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 1.1.3.2
3
+ Version: 1.1.3.4
4
4
  Summary: A Discord bot interpreter for creating custom commands and automations.
5
5
  Home-page: https://github.com/BOXERRMD/Dshell_Interpreter
6
6
  Author: Chronos
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="dshellInterpreter",
8
- version="1.1.3.2",
8
+ version="1.1.3.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.",