Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: "node_modules|migrations|.venv|tests/dev/|tests/fixtures/|presentations
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=500"]
Expand All @@ -17,19 +17,19 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/psf/black
rev: 24.10.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 8.0.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
rev: 7.3.0
hooks:
- id: flake8
language: python
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!python3

"""
Configuration for project documentation using Sphinx.
Configuration for project documentation using Sphinx.
"""

# standard
Expand Down
4 changes: 2 additions & 2 deletions gml_application_schema_toolbox/__about__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! python3 # noqa: E265

"""
Metadata about the package to easily retrieve informations about it.
See: https://packaging.python.org/guides/single-sourcing-package-version/
Metadata about the package to easily retrieve informations about it.
See: https://packaging.python.org/guides/single-sourcing-package-version/
"""

from configparser import ConfigParser
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3 # noqa: E265

"""
Plugin constants.
Plugin constants.
"""

# ############################################################################
Expand Down
8 changes: 2 additions & 6 deletions gml_application_schema_toolbox/core/gmlas_xpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,10 @@ def resolve_xpath(self, ogr_layer_name, ogr_layer_pkid_name, pkid_value, xpath):
field_name = None
field_category = None
field_max_occurs = 0
for f in self._ds.ExecuteSQL(
"""
for f in self._ds.ExecuteSQL("""
select field_xpath, field_name, field_category, field_max_occurs
from {}_ogr_fields_metadata
where layer_name='{}'""".format(
self._schema, ogr_layer_name
)
):
where layer_name='{}'""".format(self._schema, ogr_layer_name)):
field_xpath = f.GetField("field_xpath").split("/")
if lstartswith(field_xpath, layer_xpath):
# remove the layer_xpath
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/gui/bbox_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def useLayerExtent(self):
layerName = layer.name()
extents.append(layerName)
extentsDict[layerName] = {"extent": layer.extent(), "authid": authid}
(item, ok) = QInputDialog.getItem(
item, ok = QInputDialog.getItem(
self, self.tr("Select extent"), self.tr("Use extent from"), extents, False
)
if ok:
Expand Down
1 change: 1 addition & 0 deletions gml_application_schema_toolbox/gui/gmlas_panel_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* *
***************************************************************************/
"""

# PyQGIS
import processing

Expand Down
8 changes: 2 additions & 6 deletions gml_application_schema_toolbox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ def unload(self):
def onAbout(self):
self.about_dlg = QWidget()
vlayout = QVBoxLayout()
lbl_about_main = QLabel(
"""
lbl_about_main = QLabel("""
<h1>{}</h1>
<h3>Version: {}</h3>
<p>This plugin is a prototype aiming at experimenting with the manipulation of <b>Complex Features</b> streams.</p>
Expand Down Expand Up @@ -221,10 +220,7 @@ def onAbout(self):
<li><b>The Association of Finnish Local and Regional Authorities</b> (through <a href="http://www.gispo.fi">Gispo.fi</a>)</li>
</ul>
</p>
""".format(
__title__, __version__
)
)
""".format(__title__, __version__))
lbl_about_main.setWordWrap(True)
vlayout.addWidget(lbl_about_main)
hlayout = QHBoxLayout()
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/model_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def distance(p1, p2):
def add_link(table_name, table_name2, y_idx):
tx, ty, tw, th, table = table_pos[table_name]
tx2, ty2, tw2, th2, _ = table_pos[table_name2]
(ax, ay, aw, ah) = table.widget().attributeCoords(y_idx)
ax, ay, aw, ah = table.widget().attributeCoords(y_idx)
l1 = QLineF(ax - 3, ay + ah / 2.0, tx2 + tw2 / 2.0, ty2 + th2 / 2.0)
l2 = QLineF(ax + aw + 3, ay + ah / 2.0, tx2 + tw2 / 2.0, ty2 + th2 / 2.0)
if l1.length() < l2.length():
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/processing/provider.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3 # noqa: E265

"""
Processing provider module.
Processing provider module.
"""

# PyQGIS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3 # noqa: E265

"""
Plugin settings dialog.
Plugin settings dialog.
"""

# standard
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/toolbelt/file_downloader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3 # noqa: E265

"""
Functions used to manage network requests (remote files, etc.)
Functions used to manage network requests (remote files, etc.)
"""

# Standard library
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/toolbelt/preferences.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3 # noqa: E265

"""
Plugin settings.
Plugin settings.
"""

# standard
Expand Down
2 changes: 1 addition & 1 deletion gml_application_schema_toolbox/viewers/wml2_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def displayPlot(self):
self.scene().displayPlot()

def mouseMoveEvent(self, event):
(x, y) = (event.x(), event.y())
x, y = (event.x(), event.y())
pt = self.mapToScene(x, y)
self.scene().onMouseOver(pt)

Expand Down
17 changes: 8 additions & 9 deletions tests/qgis/test_custom_viewers.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

Launch it with something like
Launch it with something like

`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_custom_viewers.py`
`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_custom_viewers.py`

.. code-block:: bash
.. code-block:: bash

# for whole tests
python -m unittest tests.test_custom_viewers
# for specific test
python -m unittest tests.test_custom_viewers.TestCustomViewers.test_custom_viewers_layer
# for whole tests
python -m unittest tests.test_custom_viewers
# for specific test
python -m unittest tests.test_custom_viewers.TestCustomViewers.test_custom_viewers_layer
"""


# PyQGIS
from qgis.testing import unittest
from sip import wrappertype
Expand Down
12 changes: 6 additions & 6 deletions tests/qgis/test_gmlas_xpath.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

.. code-block:: bash
.. code-block:: bash

# for whole tests
python -m unittest tests.test_gmlas_xpath
# for specific test
python -m unittest tests.test_gmlas_xpath.TestGMLASXPath.test_geologylog
# for whole tests
python -m unittest tests.test_gmlas_xpath
# for specific test
python -m unittest tests.test_gmlas_xpath.TestGMLASXPath.test_geologylog
"""

# standard library
Expand Down
17 changes: 8 additions & 9 deletions tests/qgis/test_load_as_xml.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

Launch it with something like
Launch it with something like

`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_load_as_xml.py`
`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_load_as_xml.py`

.. code-block:: bash
.. code-block:: bash

# for whole tests
python -m unittest tests.test_load_as_xml
# for specific test
python -m unittest tests.test_load_as_xml.TestLoadAsXML.test_load_as_xml_layer
# for whole tests
python -m unittest tests.test_load_as_xml
# for specific test
python -m unittest tests.test_load_as_xml.TestLoadAsXML.test_load_as_xml_layer
"""


# standard library
from pathlib import Path

Expand Down
16 changes: 8 additions & 8 deletions tests/qgis/test_load_in_qgis.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

Launch it with something like
Launch it with something like

`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_load_in_qgis.py`
`QGIS_DEBUG=0 QGIS_PREFIX_PATH=/home/hme/src/QGIS/build/output PYTHONPATH=/home/hme/src/QGIS/build/output/python python3 test_load_in_qgis.py`

.. code-block:: bash
.. code-block:: bash

# for whole tests
python -m unittest tests.test_load_in_qgis
# for specific test
python -m unittest tests.test_load_in_qgis.TestLoadInQGIS.test_geologylog
# for whole tests
python -m unittest tests.test_load_in_qgis
# for specific test
python -m unittest tests.test_load_in_qgis.TestLoadInQGIS.test_geologylog
"""

# standard library
Expand Down
12 changes: 6 additions & 6 deletions tests/qgis/test_plg_preferences.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

.. code-block:: bash
.. code-block:: bash

# for whole tests
python -m unittest tests.test_plg_preferences
# for specific test
python -m unittest tests.test_plg_preferences.TestPlgPreferences.test_plg_preferences_structure
# for whole tests
python -m unittest tests.test_plg_preferences
# for specific test
python -m unittest tests.test_plg_preferences.TestPlgPreferences.test_plg_preferences_structure
"""

# standard library
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/test_plg_metadata.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#! python3 # noqa E265

"""
Usage from the repo root folder:
Usage from the repo root folder:

.. code-block:: bash
# for whole tests
python -m unittest tests.test_plg_metadata
# for specific test
python -m unittest tests.test_plg_metadata.TestPluginMetadata.test_version_semver
.. code-block:: bash
# for whole tests
python -m unittest tests.test_plg_metadata
# for specific test
python -m unittest tests.test_plg_metadata.TestPluginMetadata.test_version_semver
"""

# standard library
Expand Down
Loading