PycordViews 1.3.1__py3-none-any.whl → 1.3.3__py3-none-any.whl

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.
@@ -1,3 +1,4 @@
1
+ from queue import Empty
1
2
  from multiprocessing import get_context
2
3
  from multiprocessing.queues import Queue
3
4
  from .process import ManageProcess
@@ -31,8 +32,10 @@ class Multibot:
31
32
  try:
32
33
  result = self.__process_queue.get(timeout=self.global_timeout)
33
34
  return result
34
- except:
35
+ except Empty:
35
36
  return {'status': 'error', 'message': 'timeout request exceeded'}
37
+ except ValueError:
38
+ return {'status': 'critical error', 'message': 'queue was closed !'}
36
39
 
37
40
  def _start_process(self):
38
41
  """
@@ -4,6 +4,7 @@ from .bot import DiscordBot
4
4
  from discord import Intents
5
5
  from immutableType import Str_
6
6
  from sys import modules
7
+ from os import system
7
8
 
8
9
  class ManageProcess:
9
10
 
@@ -189,7 +190,8 @@ class ManageProcess:
189
190
  if module in modules_name:
190
191
  self.removed_modules[module] = modules.pop(module)
191
192
  else:
192
- raise ModuleNotFoundError(module)
193
+ system(f"pip uninstall {module}")
194
+ #raise ModuleNotFoundError(module)
193
195
  return f"[{', '.join(modules_name)}] modules removed"
194
196
 
195
197
  def add_modules(self, modules_name: tuple[str]):
@@ -203,7 +205,8 @@ class ManageProcess:
203
205
  if module in self.removed_modules.keys():
204
206
  modules[module] = self.removed_modules.pop(module)
205
207
  else:
206
- raise ModuleNotFoundError(module)
208
+ system(f"pip install {module}")
209
+ #raise ModuleNotFoundError(module)
207
210
  return f"[{', '.join(modules_name)}] modules added"
208
211
 
209
212
  def is_started(self, bot_name: str) -> bool:
@@ -103,14 +103,14 @@ class EasyModifiedViews(View):
103
103
  """
104
104
  Decorator to set up a callable for the item
105
105
 
106
- **Interaction parameter is required in coroutine function !**
106
+ **Ui, Interaction and data parameters is required in coroutine function !**
107
107
 
108
108
  view = EasyModifiedViews(None)
109
109
  view.add_view(discord.ui.Button(label='coucou', custom_id='test_ID'))
110
110
 
111
111
  @view.set_callable_decorator(custom_id='test_ID')
112
112
 
113
- async def rep(**UI**, **interaction**):
113
+ async def rep(**UI**, **interaction**, data):
114
114
  await interaction.response.send_message('coucou !!!')
115
115
 
116
116
  await ctx.respond('coucou', view=view)
@@ -144,7 +144,7 @@ class EasyModifiedViews(View):
144
144
  :param autorised_roles: Any role ID allowed to interact with the view
145
145
  :param autorised_key: Callable function to check anything. The function get the current interaction passed in parameter
146
146
 
147
- **UI and Interaction parameter is required in callable function !**
147
+ **UI, Interaction and data parameter is required in callable function !**
148
148
 
149
149
  view = EasyModifiedViews(None)
150
150
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PycordViews
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: Views and multibot for py-cord library
5
5
  Home-page: https://github.com/BOXERRMD/Py-cord_Views
6
6
  Author: Chronos (alias BOXERRMD)
@@ -12,17 +12,17 @@ pycordViews/modal/errors.py,sha256=nIGYyOS_oWH49Dj8ZGW53nnzaPmbvFbAo7ydikD5xWE,3
12
12
  pycordViews/multibot/__init__.py,sha256=93Q_URiRUMsvwQJIqUnb75aq6SPM83yteSMrH0rmXMg,30
13
13
  pycordViews/multibot/bot.py,sha256=pD-BPXNo7JeJPguTn7qLii0UzBSS4ITvmOPv8htKJG8,8284
14
14
  pycordViews/multibot/errors.py,sha256=sPl_mM6b72Q8uuz4JkocO0TKBQ_9R3f0yT5eGhH_-PY,1328
15
- pycordViews/multibot/multibot.py,sha256=625UTZ1FcgjR_BzXv2LZfkXonq9qosB_C1-zazr1pYs,9112
16
- pycordViews/multibot/process.py,sha256=efSWVeHxrN88RdikUb3oOm8pAKgnQn2Q20CZqXGATfo,10114
15
+ pycordViews/multibot/multibot.py,sha256=A_abouhHcellnBNbgN7uF9UheApQwptfUuDt2tZQZZc,9253
16
+ pycordViews/multibot/process.py,sha256=-rJTw6ACfvMMinoAhQVGqPx76m0Nai5nymtDv1LrnxQ,10239
17
17
  pycordViews/pagination/__init__.py,sha256=rvOp-nGXZ6EX_ojK1_1lcOHYUcrB0LG3DL7zwatkRPY,105
18
18
  pycordViews/pagination/errors.py,sha256=CYb5gBcXx0kYDUDkNpfUrqSxQAcJE_qfpomWtUFOsTk,316
19
19
  pycordViews/pagination/page.py,sha256=sKi_gCFt1euY7uJKWgMnxEqP1B4LMhUysxQ8oQbhNVQ,1147
20
20
  pycordViews/pagination/pagination_view.py,sha256=t6wvTLNTYg-w4eJQiyiX-LmEeR385SChifUzhiVSZBs,5793
21
21
  pycordViews/views/__init__.py,sha256=yligptZmw-np8tjKLr76SVmi0807Nk6jCyKkKYLhbCY,89
22
- pycordViews/views/easy_modified_view.py,sha256=dOiSZ59zthRUV6s-mzdnql0o-z6hQM2ppKShJjmipu0,13992
22
+ pycordViews/views/easy_modified_view.py,sha256=zWMrmtcIE7VJxkMrFlzEdLCuhdvBUzNybl_8bQBzq-s,14018
23
23
  pycordViews/views/errors.py,sha256=AkhGskuBjbFs0ZQdTDlVyfvAJ1WRMMQx2sAXUnYjmog,360
24
- pycordviews-1.3.1.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
25
- pycordviews-1.3.1.dist-info/METADATA,sha256=Qf2sc2nqKIu9X02j7OEjSs4vVjHA5EC14fXgglLjVyI,12417
26
- pycordviews-1.3.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
27
- pycordviews-1.3.1.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
28
- pycordviews-1.3.1.dist-info/RECORD,,
24
+ pycordviews-1.3.3.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
25
+ pycordviews-1.3.3.dist-info/METADATA,sha256=lQcNdibilr45yYH3X_AWg4GKu-HMbFdVJHUfgCkqePI,12417
26
+ pycordviews-1.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ pycordviews-1.3.3.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
28
+ pycordviews-1.3.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5