generated from teksi/template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugin as it is now from https://github.com/teksi/wastewater_old
qgep qwat to ili is added as not submodule
- Loading branch information
Showing
129 changed files
with
129,307 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: 🔌 Plugin | Package and release | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- plugin/** | ||
- '.github/workflows/datamodel-create-dumps.yml' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
plugin-package: | ||
name: Packages and releases plugin | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install qgis-plugin-ci | ||
run: pip install qgis-plugin-ci>=2.8.6b2 | ||
|
||
- name: Package modelbaker | ||
run: plugin/scripts/package_pip_packages.sh | ||
|
||
- name: Package | ||
run: | | ||
VERSION=0.0.0 | ||
qgis-plugin-ci -v package ${VERSION} \ | ||
--allow-uncommitted-changes --asset-path plugin/teksi_wastewater/libs | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: teksi_wastewater_plugin_dev | ||
path: plugin/teksi_wastewater.0.0.0.zip | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: 🪲 Plugin | Tests | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- datamodel/** | ||
- plugin/** | ||
- '.github/workflows/plugin-test.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- datamodel/** | ||
- plugin/** | ||
- '.github/workflows/plugin-test.yml' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
plugin-tests: | ||
name: Run unit tests on plugin | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
qgis_version: [3.28-jammy, latest] | ||
env: | ||
QGIS_TEST_VERSION: ${{ matrix.qgis_version }} | ||
COMPOSE_PROFILES: qgis | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Package PyPI Packages | ||
run: | | ||
sudo ./plugin/scripts/package_pip_packages.sh | ||
- name: Docker build | ||
run: docker compose up -d --build | ||
|
||
- name: Test on QGIS | ||
run: docker-compose run qgis /usr/src/.docker/run-docker-tests.sh | ||
|
||
- name: docker logs | ||
#if: failure() | ||
run: docker compose logs db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugin_path: plugin/teksi_wastewater | ||
github_organization_slug: TEKSI | ||
project_slug: wastewater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG QGIS_TEST_VERSION=latest | ||
FROM opengisch/qgis:${QGIS_TEST_VERSION} | ||
|
||
# remove QGIS apt repo to avoid signing key issues | ||
RUN add-apt-repository -r https://qgis.org/ubuntu && \ | ||
add-apt-repository -r https://qgis.org/ubuntu-ltr | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install openjdk-8-jre curl locales postgresql-client python3-geoalchemy2 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV LANG=C.UTF-8 | ||
|
||
WORKDIR / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
#*************************************************************************** | ||
# ------------------- | ||
# begin : 2017-08-24 | ||
# git sha : :%H$ | ||
# copyright : (C) 2017 by OPENGIS.ch | ||
# email : info@opengis.ch | ||
#*************************************************************************** | ||
# | ||
#*************************************************************************** | ||
#* * | ||
#* This program is free software; you can redistribute it and/or modify * | ||
#* it under the terms of the GNU General Public License as published by * | ||
#* the Free Software Foundation; either version 2 of the License, or * | ||
#* (at your option) any later version. * | ||
#* * | ||
#*************************************************************************** | ||
|
||
set -e | ||
|
||
pushd /usr/src | ||
DEFAULT_PARAMS='-v' | ||
xvfb-run pytest-3 ${@:-`echo $DEFAULT_PARAMS`} $1 | ||
popd |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
LIBS_DIR="plugin/teksi_wastewater/libs" | ||
|
||
MODELBAKER_LIBRARY=("modelbaker" "1.6.0") | ||
|
||
PACKAGES=( | ||
MODELBAKER_LIBRARY[@] | ||
) | ||
|
||
#create lib folder | ||
mkdir -p $LIBS_DIR | ||
|
||
for PACKAGE in ${PACKAGES[@]}; do | ||
echo download and unpack ${!PACKAGE:0:1} with version ${!PACKAGE:1:1} | ||
#create temp folder | ||
mkdir -p temp | ||
#download the wheel | ||
pip download -v ${!PACKAGE:0:1}==${!PACKAGE:1:1} --only-binary :all: -d temp/ | ||
#unpack all the wheels found (means including dependencies) | ||
unzip -o "temp/*.whl" -d $LIBS_DIR | ||
#remove temp folder | ||
rm -r temp | ||
#set write rights to group (because qgis-plugin-ci needs it) | ||
chmod -R g+w $LIBS_DIR | ||
done | ||
|
||
#create the __init__.py in libs folder | ||
cd $LIBS_DIR | ||
touch __init__.py | ||
chmod g+w __init__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Arguments are passed one to one to pytest | ||
# | ||
# Run all tests: | ||
# ./scripts/run-tests.sh # Run all tests | ||
# | ||
# Run all test starting with test_array_ | ||
# ./scripts/run-tests.sh -k test_array_ | ||
|
||
docker-compose run qgis /usr/src/.docker/run-docker-tests.sh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ----------------------------------------------------------- | ||
# | ||
# TEKSI Wastewater | ||
# Copyright (C) 2012 Matthias Kuhn | ||
# ----------------------------------------------------------- | ||
# | ||
# licensed under the terms of GNU GPL 2 | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
# | ||
# --------------------------------------------------------------------- | ||
|
||
|
||
def classFactory(iface): | ||
from .teksi_wastewater_plugin import TeksiWastewaterPlugin | ||
|
||
return TeksiWastewaterPlugin(iface) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# ----------------------------------------------------------- | ||
# | ||
# Profile | ||
# Copyright (C) 2012 Patrice Verchere | ||
# ----------------------------------------------------------- | ||
# | ||
# licensed under the terms of GNU GPL 2 | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, print to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
# | ||
# --------------------------------------------------------------------- | ||
|
||
import os | ||
|
||
from qgis.PyQt.QtCore import QSettings | ||
from qgis.PyQt.QtWidgets import QDialog | ||
|
||
from ..utils import get_ui_class | ||
|
||
DIALOG_UI = get_ui_class("dlgabout.ui") | ||
|
||
|
||
class DlgAbout(QDialog, DIALOG_UI): | ||
def __init__(self, parent=None): | ||
QDialog.__init__(self, parent) | ||
self.setupUi(self) | ||
|
||
fp = os.path.join( | ||
os.path.abspath(os.path.join(os.path.dirname(__file__), "..")), | ||
"metadata.txt", | ||
) | ||
|
||
ini_text = QSettings(fp, QSettings.IniFormat) | ||
verno = ini_text.value("version") | ||
name = ini_text.value("name") | ||
description = ini_text.value("description") | ||
|
||
self.title.setText(name) | ||
self.description.setText(description + " - " + verno) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import qgis | ||
from qgis.core import QgsProject | ||
|
||
from ..tools.twwmaptooladdfeature import TwwMapToolDigitizeDrainageChannel | ||
|
||
|
||
def geometryDigitized(fid, layer, tool): | ||
layer.changeGeometry(fid, tool.geometry) | ||
layer.triggerRepaint() | ||
tool.deactivate() | ||
|
||
|
||
def mapToolDeactivated(tool): | ||
tool.deactivated.disconnect() | ||
qgis.utils.plugins["teksi_wastewater"].iface.mapCanvas().unsetMapTool(tool) | ||
tool.deleteLater() | ||
|
||
|
||
def digitizeDrainageChannel(fid, layerid): | ||
layer = QgsProject.instance().mapLayer(layerid) | ||
layer.startEditing() | ||
tool = TwwMapToolDigitizeDrainageChannel(qgis.utils.plugins["teksi_wastewater"].iface, layer) | ||
qgis.utils.plugins["teksi_wastewater"].iface.mapCanvas().setMapTool(tool) | ||
tool.geometryDigitized.connect(lambda: geometryDigitized(fid, layer, tool)) | ||
# form.window().hide() | ||
tool.deactivated.connect(lambda: mapToolDeactivated(tool)) |
Oops, something went wrong.