componentsv2 0.3.0__tar.gz → 0.3.2__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 (33) hide show
  1. {componentsv2-0.3.0 → componentsv2-0.3.2}/PKG-INFO +1 -1
  2. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/holders/container.py +20 -2
  3. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2.egg-info/PKG-INFO +1 -1
  4. {componentsv2-0.3.0 → componentsv2-0.3.2}/pyproject.toml +1 -1
  5. {componentsv2-0.3.0 → componentsv2-0.3.2}/LICENSE.txt +0 -0
  6. {componentsv2-0.3.0 → componentsv2-0.3.2}/README.md +0 -0
  7. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/__init__.py +0 -0
  8. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/component_holder.py +0 -0
  9. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/__init__.py +0 -0
  10. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/action_row.py +0 -0
  11. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/base.py +0 -0
  12. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/button.py +0 -0
  13. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/checkbox.py +0 -0
  14. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/file_upload.py +0 -0
  15. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/gallery.py +0 -0
  16. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/holders/__init__.py +0 -0
  17. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/holders/label.py +0 -0
  18. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/holders/nestable.py +0 -0
  19. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/holders/section.py +0 -0
  20. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/media.py +0 -0
  21. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/radio_group.py +0 -0
  22. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/select.py +0 -0
  23. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/separator.py +0 -0
  24. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/text_display.py +0 -0
  25. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/components/text_input.py +0 -0
  26. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/utils/__init__.py +0 -0
  27. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/utils/serialize.py +0 -0
  28. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2/wrapper.py +0 -0
  29. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2.egg-info/SOURCES.txt +0 -0
  30. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2.egg-info/dependency_links.txt +0 -0
  31. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2.egg-info/requires.txt +0 -0
  32. {componentsv2-0.3.0 → componentsv2-0.3.2}/componentsv2.egg-info/top_level.txt +0 -0
  33. {componentsv2-0.3.0 → componentsv2-0.3.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: componentsv2
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  License-File: LICENSE.txt
5
5
  Requires-Dist: nextcord
6
6
  Dynamic: license-file
@@ -7,7 +7,10 @@ from ..text_display import TextDisplay
7
7
  from typing import Optional
8
8
 
9
9
  class Container(Nestable):
10
- def __init__(self, components: list[ComponentV2] = [], accent_color: int = None, spoiler: bool = None, id: Optional[int] = None):
10
+ def __init__(self, components: list[ComponentV2] = None, accent_color: int = None, spoiler: bool = None, id: Optional[int] = None):
11
+ if components is None:
12
+ components = []
13
+
11
14
  for component in components:
12
15
  if hasattr(component, "__container_compatible__") == False:
13
16
  raise TypeError(f"Component {component.__class__.__name__} not accepted in Containers!")
@@ -16,6 +19,8 @@ class Container(Nestable):
16
19
 
17
20
  self.accent_color = accent_color
18
21
  self.spoiler = spoiler
22
+
23
+ self.footer = None
19
24
 
20
25
  def get_row(self, row: int) -> tuple[int, ActionRow]:
21
26
  total_rows = -1
@@ -41,10 +46,14 @@ class Container(Nestable):
41
46
 
42
47
  return self.append_component(action_row)
43
48
  else:
44
- IndexError("Action rows must be created sequentially!")
49
+ raise IndexError("Action rows must be created sequentially!")
45
50
 
46
51
  self.components.append(component)
47
52
 
53
+ if self.footer is not None:
54
+ self.components.remove(self.footer)
55
+ self.components.append(self.footer)
56
+
48
57
  return self
49
58
 
50
59
  def add_field(self, title: str, content: str):
@@ -54,6 +63,15 @@ class Container(Nestable):
54
63
  )
55
64
  )
56
65
 
66
+ def set_footer(self, footer: str):
67
+ if self.footer is not None:
68
+ self.components.remove(self.footer)
69
+
70
+ self.footer = TextDisplay(f"-# {footer}")
71
+ self.components.append(
72
+ self.footer
73
+ )
74
+
57
75
  def serialize(self):
58
76
  base_dict = super().serialize()
59
77
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: componentsv2
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  License-File: LICENSE.txt
5
5
  Requires-Dist: nextcord
6
6
  Dynamic: license-file
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "componentsv2"
7
- version = "0.3.0"
7
+ version = "0.3.2"
8
8
 
9
9
  dependencies = [
10
10
  "nextcord"
File without changes
File without changes
File without changes