Skip to content

Commit c8bfe0c

Browse files
committed
Revert "Update example to consume files from the cloned branch"
This reverts commit 103a634.
1 parent db49e42 commit c8bfe0c

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

examples/07-python-operators/02-python_operators_with_dependencies.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@
5353
"gltf_plugin/texture.png",
5454
"gltf_plugin.xml",
5555
]
56-
import os
57-
58-
folder_root = os.path.dirname(
59-
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
60-
)
61-
source_path_in_repo = r"docs\source\examples\07-python-operators\plugins"
6256
plugin_path = None
57+
GITHUB_SOURCE_URL = (
58+
"https://github.com/pyansys/pydpf-core/raw/"
59+
""
60+
"examples/first_python_plugins/python_plugins"
61+
)
6362

6463
for file in file_list:
65-
operator_file_path = os.path.join(folder_root, source_path_in_repo, file)
64+
EXAMPLE_FILE = GITHUB_SOURCE_URL + "/gltf_plugin/" + file
65+
operator_file_path = examples.downloads._retrieve_file(
66+
EXAMPLE_FILE, file, os.path.join("python_plugins", os.path.dirname(file))
67+
)
6668

6769
print(f"\033[1m {file}\n \033[0m")
6870
if (
@@ -132,12 +134,9 @@
132134
if os.name == "nt" and not os.path.exists(
133135
os.path.join(plugin_path, "assets", "gltf_sites_winx64.zip")
134136
):
135-
cmd_file = os.path.join(
136-
folder_root,
137-
"docs",
138-
"source",
139-
"user_guide",
140-
"create_sites_for_python_operators.ps1",
137+
CMD_FILE_URL = GITHUB_SOURCE_URL + "/create_sites_for_python_operators.ps1"
138+
cmd_file = examples.downloads._retrieve_file(
139+
CMD_FILE_URL, "create_sites_for_python_operators.ps1", "python_plugins"
141140
)
142141
args = [
143142
"powershell",
@@ -163,12 +162,9 @@
163162
elif os.name == "posix" and not os.path.exists(
164163
os.path.join(plugin_path, "assets", "gltf_sites_linx64.zip")
165164
):
166-
cmd_file = os.path.join(
167-
folder_root,
168-
"docs",
169-
"source",
170-
"user_guide",
171-
"create_sites_for_python_operators.sh",
165+
CMD_FILE_URL = GITHUB_SOURCE_URL + "/create_sites_for_python_operators.sh"
166+
cmd_file = examples.downloads._retrieve_file(
167+
CMD_FILE_URL, "create_sites_for_python_operators.ps1", "python_plugins"
172168
)
173169
run_cmd = f"{cmd_file}"
174170
args = (

0 commit comments

Comments
 (0)