Skip to content

[Bug] Compilation with CMake doesn't copy all additional r.in.wms script module Py modules #7481

Description

@tmszi

Describe the bug

It is not possible launch wxGUI Add web service map tool.

To reproduce

  1. Launch wxGUI
  2. From the Layers toolbar pane launch wxGUI Add web service map tool
  3. See error
Traceback (most recent call last):
  File
"/usr/lib64/grass86/gui/wxpython/main_window/frame.py", line
1976, in OnAddWS
    from web_services.dialogs import AddWSDialog
  File
"/usr/lib64/grass86/gui/wxpython/web_services/dialogs.py",
line 41, in <module>
    from web_services.widgets import WSPanel,
WSManageSettingsWidget
  File
"/usr/lib64/grass86/gui/wxpython/web_services/widgets.py",
line 44, in <module>
    from web_services.cap_interface import (
    ...<3 lines>...
    )
  File "/usr/lib64/grass86/gui/wxpython/web_services/cap_int
erface.py", line 33, in <module>
    from wms_cap_parsers import (  # noqa: E402
    ...<3 lines>...
    )
ModuleNotFoundError: No module named 'wms_cap_parsers'

WMSLibPath = os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms")
if WMSLibPath not in sys.path:
sys.path.append(WMSLibPath)
# Import only after the path has been set up.
from wms_cap_parsers import ( # noqa: E402
WMSCapabilitiesTree,
WMTSCapabilitiesTree,
OnEarthCapabilitiesTree,
)

Aditional r.in.wms module Py modules are not founded:

tomas@gentoo-gnu-linux:~$ find /usr/lib64/grass86/ -type f -name "wms_cap_parsers.py" -o -name "srs.py" -o -name "wms_base.py" -o -name "wms_drv.py" -o -name "wms_gdal_drv.py"
tomas@gentoo-gnu-linux:~$

Expected behavior

Launching wxGUI Add web service map tool, should work. And during compilation process should be copied r.in.wms module all additional Py modules to the right directory etc/.

System description

  • Operating System: all
  • GRASS version: 8.6.0dev, 8.5.0

Additional context

# TODO: Create CMakeLists.txt in scripts/r.in.wms and scripts/wxpyimgview
# respectively, and put the following there.
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms
DESTINATION ${OUTDIR}/${GRASS_INSTALL_ETCBINDIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/wxpyimgview/wxpyimgview_gui.py
DESTINATION ${OUTDIR}/${GRASS_INSTALL_ETCBINDIR})
add_custom_target(
r.in.wms_files
COMMAND ${CMAKE_COMMAND} -E make_directory
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms/wms_base.py
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms/wms_cap_parsers.py
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
COMMAND
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms/wms_drv.py
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms/wms_gdal_drv.py
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/r.in.wms/srs.py
${OUTDIR}/${GRASS_INSTALL_ETCBINDIR}/r.in.wms
DEPENDS v.to.lines)
add_dependencies(r.in.wms r.in.wms_files)
set_target_properties(r.in.wms_files PROPERTIES FOLDER "Tools/Raster")

Metadata

Metadata

Assignees

No one assigned

    Labels

    CMakebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions