dshellInterpreter 1.2.7.4__tar.gz → 1.2.7.5__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 (54) hide show
  1. dshellinterpreter-1.2.7.5/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +31 -0
  2. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellPreProcess/dshell_preprocess.py +5 -1
  3. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/full_import.py +0 -1
  4. {dshellinterpreter-1.2.7.4/dshellInterpreter.egg-info → dshellinterpreter-1.2.7.5}/PKG-INFO +2 -2
  5. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5/dshellInterpreter.egg-info}/PKG-INFO +2 -2
  6. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/setup.py +2 -2
  7. dshellinterpreter-1.2.7.4/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -28
  8. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  9. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
  10. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_embed.py +0 -0
  11. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_file.py +0 -0
  12. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
  13. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
  14. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
  15. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
  16. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/dshell_ui.py +0 -0
  17. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
  18. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py +0 -0
  19. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_file.py +0 -0
  20. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_global.py +0 -0
  21. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_list.py +0 -0
  22. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_member.py +0 -0
  23. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
  24. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_numbers.py +0 -0
  25. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +0 -0
  26. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_string.py +0 -0
  27. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
  28. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DISCORD_COMMANDS/utils/utils_type_validation.py +0 -0
  29. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/__init__.py +0 -0
  30. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/cached_messages.py +0 -0
  31. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/dshell_arguments.py +0 -0
  32. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/dshell_global_variables.py +0 -0
  33. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/dshell_interpreter.py +0 -0
  34. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/dshell_iterators.py +0 -0
  35. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/dshell_scope.py +0 -0
  36. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/errors.py +0 -0
  37. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellInterpreteur/utils_interpreter.py +0 -0
  38. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellParser/__init__.py +0 -0
  39. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellParser/ast_nodes.py +0 -0
  40. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellParser/dshell_parser.py +0 -0
  41. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellParser/errors.py +0 -0
  42. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellPreProcess/__init__.py +0 -0
  43. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellTokenizer/__init__.py +0 -0
  44. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellTokenizer/dshell_keywords.py +0 -0
  45. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellTokenizer/dshell_token_type.py +0 -0
  46. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/DshellTokenizer/dshell_tokenizer.py +0 -0
  47. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/Dshell/__init__.py +0 -0
  48. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/LICENSE +0 -0
  49. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/README.md +0 -0
  50. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  51. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  52. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/dshellInterpreter.egg-info/requires.txt +0 -0
  53. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/dshellInterpreter.egg-info/top_level.txt +0 -0
  54. {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.5}/setup.cfg +0 -0
@@ -0,0 +1,31 @@
1
+ from requests import get
2
+ from Dshell.full_import import Message
3
+ from .utils.utils_type_validation import _validate_required_string
4
+ from ..DshellParser.ast_nodes import StrNode, BoolNode, ListNode, FileNode
5
+ from .dshell_file import dshell_write_file
6
+
7
+ __all__ = [
8
+ 'dshell_get_pastbin'
9
+ ]
10
+
11
+
12
+ async def dshell_get_pastbin(ctx: Message, code: StrNode) -> FileNode:
13
+ """
14
+ Get a pastbin from a code snippet.
15
+ Return a FileNode to stream the result
16
+ """
17
+ _CMD = "gp"
18
+
19
+ _validate_required_string(code, "code", _CMD)
20
+
21
+ content = FileNode(name=StrNode(f"Pastbin {code}"))
22
+
23
+ with get(f"https://pastebin.com/raw/{code}", stream=True, timeout=10) as response:
24
+
25
+ if not response.ok:
26
+ raise Exception(f"Failed to retrieve pastbin with code {code} !")
27
+
28
+ for line in response.iter_lines(decode_unicode=True, chunk_size=1024):
29
+ await dshell_write_file(ctx, StrNode(line), append=BoolNode(1), file=content)
30
+
31
+ return content
@@ -3,6 +3,10 @@ from ..full_import import sub, MULTILINE, StrEnum, search, compile, DOTALL
3
3
  class PreProcessorInstructions(StrEnum):
4
4
  DEFINE = "define"
5
5
 
6
+ @classmethod
7
+ def contain(cls, key: str, /) -> bool:
8
+ return any(member.value == key for member in cls)
9
+
6
10
  class PreProcessorData:
7
11
  def __init__(self, instruction: str, symbol: str, value: str):
8
12
  self.instruction = instruction
@@ -37,7 +41,7 @@ def preProcessor(code: list[str]) -> list[str]:
37
41
  instruction: str = pre_processor_match.group(1).lower()
38
42
  symbol: str = pre_processor_match.group(2)
39
43
  value: str = pre_processor_match.group(3)
40
- if instruction in PreProcessorInstructions:
44
+ if PreProcessorInstructions.contain(instruction):
41
45
  pre_processor_data.append(PreProcessorData(instruction, symbol, value))
42
46
 
43
47
  else:
@@ -5,7 +5,6 @@ from copy import deepcopy
5
5
  from pycordViews import EasyModifiedViews, SelectMenu
6
6
  from pycordViews.views.errors import CustomIDNotFound
7
7
  from datetime import timedelta, datetime, UTC
8
- from requests import get
9
8
 
10
9
  from discord.ui import Button, Select
11
10
  from discord import *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 1.2.7.4
3
+ Version: 1.2.7.5
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
@@ -11,7 +11,7 @@ Project-URL: Source, https://github.com/BOXERRMD/Dshell_Interpreter
11
11
  Keywords: discord bot interpreter automation commands
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.10
14
+ Requires-Python: >=3.11
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Requires-Dist: py-cord==2.6.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 1.2.7.4
3
+ Version: 1.2.7.5
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
@@ -11,7 +11,7 @@ Project-URL: Source, https://github.com/BOXERRMD/Dshell_Interpreter
11
11
  Keywords: discord bot interpreter automation commands
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.10
14
+ Requires-Python: >=3.11
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Requires-Dist: py-cord==2.6.1
@@ -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.4",
8
+ version="1.2.7.5",
9
9
  author="Chronos",
10
10
  author_email="vagabonwalybi@gmail.com",
11
11
  description="A Discord bot interpreter for creating custom commands and automations.",
@@ -24,7 +24,7 @@ setup(
24
24
  "Programming Language :: Python :: 3",
25
25
  "Operating System :: OS Independent",
26
26
  ],
27
- python_requires='>=3.10',
27
+ python_requires='>=3.11',
28
28
  license="MIT",
29
29
  keywords="discord bot interpreter automation commands",
30
30
  project_urls={
@@ -1,28 +0,0 @@
1
- from Dshell.full_import import get, Message
2
- from .utils.utils_type_validation import _validate_required_string
3
- from ..DshellParser.ast_nodes import StrNode, ListNode
4
-
5
- __all__ = [
6
- 'dshell_get_pastbin'
7
- ]
8
-
9
-
10
- async def dshell_get_pastbin(ctx: Message, code: StrNode) -> ListNode:
11
- """
12
- Get a pastbin from a code snippet.
13
- """
14
- _CMD = "gp"
15
-
16
- _validate_required_string(ctx, code, _CMD)
17
-
18
- content = ListNode([]) # Initialize content to an empty string
19
-
20
- with get(f"https://pastebin.com/raw/{code}", stream=True, timeout=10) as response:
21
-
22
- if not response.ok:
23
- raise Exception(f"Failed to retrieve pastbin with code {code} !")
24
-
25
- for line in response.iter_lines(decode_unicode=True, chunk_size=512):
26
- content.add(StrNode(line))
27
-
28
- return content