|
53 | 53 | "gltf_plugin/texture.png", |
54 | 54 | "gltf_plugin.xml", |
55 | 55 | ] |
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" |
62 | 56 | plugin_path = None |
| 57 | +GITHUB_SOURCE_URL = ( |
| 58 | + "https://github.com/pyansys/pydpf-core/raw/" |
| 59 | + "" |
| 60 | + "examples/first_python_plugins/python_plugins" |
| 61 | +) |
63 | 62 |
|
64 | 63 | 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 | + ) |
66 | 68 |
|
67 | 69 | print(f"\033[1m {file}\n \033[0m") |
68 | 70 | if ( |
|
132 | 134 | if os.name == "nt" and not os.path.exists( |
133 | 135 | os.path.join(plugin_path, "assets", "gltf_sites_winx64.zip") |
134 | 136 | ): |
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" |
141 | 140 | ) |
142 | 141 | args = [ |
143 | 142 | "powershell", |
|
163 | 162 | elif os.name == "posix" and not os.path.exists( |
164 | 163 | os.path.join(plugin_path, "assets", "gltf_sites_linx64.zip") |
165 | 164 | ): |
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" |
172 | 168 | ) |
173 | 169 | run_cmd = f"{cmd_file}" |
174 | 170 | args = ( |
|
0 commit comments