Ver Fonte

propagate init file (#226)

Jean-Robin há 1 ano atrás
pai
commit
f594b46b02
3 ficheiros alterados com 34 adições e 62 exclusões
  1. 11 62
      src/taipy/__init__.py
  2. 2 0
      src/taipy/gui_core/__init__.py
  3. 21 0
      src/taipy/gui_core/_init.py

+ 11 - 62
src/taipy/__init__.py

@@ -13,73 +13,22 @@ from importlib.util import find_spec
 
 
 if find_spec("taipy"):
 if find_spec("taipy"):
     if find_spec("taipy.config"):
     if find_spec("taipy.config"):
-        from taipy.config import Config, Frequency, Scope
-
-    if find_spec("taipy.core"):
-        from taipy.core._core import Core
-        from taipy.core.cycle.cycle import Cycle
-        from taipy.core.cycle.cycle_id import CycleId
-        from taipy.core.data.data_node import DataNode
-        from taipy.core.data.data_node_id import DataNodeId
-        from taipy.core.job.job import Job
-        from taipy.core.job.job_id import JobId
-        from taipy.core.job.status import Status
-        from taipy.core.pipeline.pipeline import Pipeline
-        from taipy.core.pipeline.pipeline_id import PipelineId
-        from taipy.core.scenario.scenario import Scenario
-        from taipy.core.scenario.scenario_id import ScenarioId
-        from taipy.core.taipy import (
-            cancel_job,
-            clean_all_entities,
-            clean_all_entities_by_version,
-            compare_scenarios,
-            create_pipeline,
-            create_scenario,
-            delete,
-            delete_job,
-            delete_jobs,
-            export_scenario,
-            get,
-            get_cycles,
-            get_cycles_scenarios,
-            get_data_nodes,
-            get_jobs,
-            get_latest_job,
-            get_parents,
-            get_pipelines,
-            get_primary,
-            get_primary_scenarios,
-            get_scenarios,
-            get_tasks,
-            is_deletable,
-            set,
-            set_primary,
-            submit,
-            subscribe_pipeline,
-            subscribe_scenario,
-            tag,
-            unsubscribe_pipeline,
-            unsubscribe_scenario,
-            untag,
-        )
-        from taipy.core.task.task import Task
-        from taipy.core.task.task_id import TaskId
+        from taipy.config._init import *  # type: ignore
 
 
     if find_spec("taipy.gui"):
     if find_spec("taipy.gui"):
-        from taipy.gui import Gui
-
-        if find_spec("taipy.gui_core"):
-            from taipy.gui_core.GuiCoreLib import _GuiCore
+        from taipy.gui._init import *  # type: ignore
 
 
-            Gui.add_library(_GuiCore())
+    if find_spec("taipy.core"):
+        from taipy.core._init import *  # type: ignore
 
 
-        if find_spec("taipy.enterprise") and find_spec("taipy.enterprise.gui"):
-            from taipy.enterprise.gui import _init_gui_enterprise
+    if find_spec("taipy.rest"):
+        from taipy.rest._init import *  # type: ignore
 
 
-            _init_gui_enterprise(Gui)
+    if find_spec("taipy.gui_core"):
+        from taipy.gui_core._init import *  # type: ignore
 
 
-    if find_spec("taipy.rest"):
-        from taipy.rest import Rest
+    if find_spec("taipy.enterprise"):
+        from taipy.enterprise._init import *  # type: ignore
 
 
     if find_spec("taipy._run"):
     if find_spec("taipy._run"):
-        from taipy._run import _run as run
+        from taipy._run import _run as run  # type: ignore

+ 2 - 0
src/taipy/gui_core/__init__.py

@@ -8,3 +8,5 @@
 # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 # specific language governing permissions and limitations under the License.
 # specific language governing permissions and limitations under the License.
+
+from _init import *

+ 21 - 0
src/taipy/gui_core/_init.py

@@ -0,0 +1,21 @@
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+from .GuiCoreLib import _GuiCore
+
+
+def _init_gui_core():
+    from taipy.gui import Gui
+
+    Gui.add_library(_GuiCore())
+
+
+_init_gui_core()