Skip to content

Commit

Permalink
Small fixes (#169)
Browse files Browse the repository at this point in the history
* add pyogrio dependency

* deploy legger
  • Loading branch information
wvangerwen authored May 3, 2024
1 parent dc94f52 commit 5fed22e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 14 deletions.
1 change: 1 addition & 0 deletions hhnk_threedi_plugin/env/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies:
- openpyxl=3.0.9
- cached_property=1.5.2
- rtree=1.0.1
- pyogrio

- pip: # 3Di packages are not conda installable and are therefore installed by PIP
- threedi_modelchecker==2.4.0 #ThreediToolbox 2.5.5
Expand Down
1 change: 1 addition & 0 deletions hhnk_threedi_plugin/env/environment_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies:
- openpyxl=3.0.9
- cached_property=1.5.2
- rtree=1.0.1
- pyogrio

- pip: # 3Di packages are not conda installable and are therefore installed by PIP
- threedi_modelchecker==2.4.0 #ThreediToolbox 2.5.5
Expand Down
3 changes: 2 additions & 1 deletion hhnk_threedi_plugin/env/environment_services.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# """This is an environment for conda environment on ota155 and ota514
# """This is an environment for conda environment on ota155 and srv514
# Can be used as standalone env where the following utils should work:
# - hhnk-threedi-tools
# - hhnk-research-tools
Expand Down Expand Up @@ -37,6 +37,7 @@ dependencies:
- openpyxl=3.1.2
- cached_property=1.5.2
- rtree=1.0.1
- pyogrio

#Voor DataCheker
- flask # oude datachecker
Expand Down
60 changes: 47 additions & 13 deletions scripts/run_deploy_plugin_across_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,61 @@
PLUGINS_DIR = r"c://Users//{user}//AppData//Roaming//3Di//QGIS3//profiles//default//python//plugins" # noqa
plugins_dir = PLUGINS_DIR
# from pathlib import Path
users = get_users()

selected_users = []
for user in users:
try:
print(f"checking user '{user}'")
user_plugins_dir = Path(plugins_dir.format(user=user))
if user_plugins_dir.parent.is_dir():
if len([i for i in user_plugins_dir.glob("*hhnk_threedi_plugin")]) == 1:
selected_users.append(user)
except:
pass


def select_users(plugin_name="hhnk_threedi_plugin"):
"""Get users that have a plugin installed."""
users = get_users()
selected_users = []

for user in users:
try:
print(f"checking user '{user}'")
user_plugins_dir = Path(plugins_dir.format(user=user))
if user_plugins_dir.parent.is_dir():
if len([i for i in user_plugins_dir.glob(f"*{plugin_name}")]) == 1:
selected_users.append(user)
except:
pass
return selected_users


# %% HHNK-THREEDI-PLUGIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

selected_users = select_users("hhnk_threedi_plugin")

print("\nSelected users:")
print(selected_users)


# %%
deploy(
admin_user="wvangerwen",
plugins=["hhnk_threedi_plugin", "ThreeDiToolbox"],
plugins=[
"hhnk_threedi_plugin",
"ThreeDiToolbox",
"threedi_models_and_simulations",
"threedi_schematisation_editor",
],
users=selected_users,
users_ignored=[],
files_ignored=["local_settings.py", "api_key.txt"],
)


# %% LEGGERTOOL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

selected_users = select_users("legger")
print(selected_users)

# %%

deploy(
admin_user="wvangerwen",
plugins=[
"legger",
],
users=selected_users,
users_ignored=[],
files_ignored=["local_settings.py", "api_key.txt"],
)

0 comments on commit 5fed22e

Please sign in to comment.