Przeglądaj źródła

Rename _Element_with_inner_props to _ElementWithInnerProps

Fabien Lelaquais 3 miesięcy temu
rodzic
commit
d997b9d5c7

+ 1 - 1
taipy/gui/extension/__main__.py

@@ -30,7 +30,7 @@ def generate_tgb(args) -> None:  # noqa: C901
     except Exception as e:
         error(f"Couldn't open module '{package_root_dir}' ({e})")
     library: t.Optional[ElementLibrary] = None
-    for _, member in getmembers(module, lambda o: isclass(o) and issubclass(o, ElementLibrary)):
+    for _, member in getmembers(module, lambda o: issubclass(o, ElementLibrary)):
         if library:
             error("Extension contains more than one ElementLibrary")
         library = member()

+ 1 - 1
taipy/gui/extension/library.py

@@ -445,7 +445,7 @@ class ElementLibrary(ABC):
         return None
 
 
-class _Element_with_inner_props(Element):
+class _ElementWithInnerProps(Element):
     def __init__(
         self,
         default_property: str,

+ 7 - 7
taipy/gui_core/_GuiCoreLib.py

@@ -15,7 +15,7 @@ from datetime import datetime
 from taipy.core import Cycle, DataNode, Job, Scenario, Sequence, Task
 from taipy.gui import Gui, State
 from taipy.gui.extension import Element, ElementLibrary, ElementProperty, PropertyType
-from taipy.gui.extension.library import _Element_with_inner_props
+from taipy.gui.extension.library import _ElementWithInnerProps
 
 from ..version import _get_version
 from ._adapters import (
@@ -67,7 +67,7 @@ class _GuiCore(ElementLibrary):
     __DATANODE_SELECTOR_ERROR_VAR = "__tpgc_dn_error"
 
     __elements: dict[str, Element] = {
-        "scenario_selector": _Element_with_inner_props(
+        "scenario_selector": _ElementWithInnerProps(
             "value",
             {
                 "id": ElementProperty(PropertyType.string),
@@ -114,7 +114,7 @@ class _GuiCore(ElementLibrary):
                 ),
             },
         ),
-        "scenario": _Element_with_inner_props(
+        "scenario": _ElementWithInnerProps(
             "scenario",
             {
                 "id": ElementProperty(PropertyType.string),
@@ -145,7 +145,7 @@ class _GuiCore(ElementLibrary):
                 ),
             },
         ),
-        "scenario_dag": _Element_with_inner_props(
+        "scenario_dag": _ElementWithInnerProps(
             "scenario",
             {
                 "id": ElementProperty(PropertyType.string),
@@ -162,7 +162,7 @@ class _GuiCore(ElementLibrary):
                 "on_select": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.on_dag_select}}"),
             },
         ),
-        "data_node_selector": _Element_with_inner_props(
+        "data_node_selector": _ElementWithInnerProps(
             "value",
             {
                 "id": ElementProperty(PropertyType.string),
@@ -199,7 +199,7 @@ class _GuiCore(ElementLibrary):
                 ),
             },
         ),
-        "data_node": _Element_with_inner_props(
+        "data_node": _ElementWithInnerProps(
             __DATANODE_VIZ_DATA_NODE_PROP,
             {
                 "id": ElementProperty(PropertyType.string),
@@ -275,7 +275,7 @@ class _GuiCore(ElementLibrary):
                 ),
             },
         ),
-        "job_selector": _Element_with_inner_props(
+        "job_selector": _ElementWithInnerProps(
             "value",
             {
                 "id": ElementProperty(PropertyType.string),

+ 2 - 2
tests/gui/extension/test_library.py

@@ -16,7 +16,7 @@ import pytest
 
 from taipy.gui import Gui
 from taipy.gui.extension import Element, ElementLibrary, ElementProperty, PropertyType
-from taipy.gui.extension.library import _Element_with_inner_props
+from taipy.gui.extension.library import _ElementWithInnerProps
 
 
 def render_xhtml_4_my_library(properties: t.Dict[str, t.Any]) -> str:
@@ -54,7 +54,7 @@ class MyLibrary(ElementLibrary):
             "h1",
             render_xhtml=render_xhtml_4_my_library_fail,
         ),
-        "inner": _Element_with_inner_props(
+        "inner": _ElementWithInnerProps(
             "value",
             {"value": ElementProperty(PropertyType.string, "")},
             inner_properties={