Skip to content

Commit

Permalink
Merge pull request #101 from 3liz/qjazz-supports
Browse files Browse the repository at this point in the history
Change 'py-qgis-server2' support to 'qjazz' support
  • Loading branch information
Gustry authored Jan 6, 2025
2 parents f1178fe + b2d7367 commit 5278af6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lizmap_server/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def create_server_context() -> ServerContext:
# a py-qgis-server instance
if hasattr(m, '_is_py_qgis_server'):
from .py_qgis_server import Context
elif hasattr(m, '_is_py_qgis_server2'):
from .py_qgis_server2 import Context # type: ignore [assignment]
elif hasattr(m, '_is_qjazz_server'):
from .qjazz import Context # type: ignore [assignment]
else:
from .native import Context # type: ignore [assignment]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from functools import cached_property
from typing import Dict, Iterator, List, Optional, Sequence, Tuple

from py_qgis_contrib.core.qgis import QgisPluginService
from py_qgis_contrib.core import logger
from py_qgis_cache import CacheEntry, CacheManager, ProjectMetadata
from py_qgis_cache import CheckoutStatus as Co
from qjazz_contrib.core.qgis import QgisPluginService
from qjazz_contrib.core import logger
from qjazz_cache.prelude import CacheEntry, CacheManager, ProjectMetadata
from qjazz_cache.prelude import CheckoutStatus as Co

from qgis.core import QgsProject

Expand All @@ -18,7 +18,7 @@
)


SERVER_CONTEXT_NAME = 'py-qgis-server2'
SERVER_CONTEXT_NAME = 'qjazz'


class Context(ContextABC):
Expand Down Expand Up @@ -106,7 +106,7 @@ def metadata(self) -> ServerMetadata:
""" Return server metadata
"""
from importlib import metadata
version = metadata.version('py_qgis_cache')
version = metadata.version('qjazz_cache')
return ServerMetadata(
name=SERVER_CONTEXT_NAME,
version=version,
Expand Down
7 changes: 4 additions & 3 deletions lizmap_server/server_info_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ def _handleRequest(self, context):
tag = ""

if server_metadata:
py_qgis_server = dict(
qgis_server_meta = dict(
found=True,
name=server_metadata.name,
version=server_metadata.version,
build_id=server_metadata.build_id,
commit_id=server_metadata.commit_id,
Expand All @@ -160,7 +161,7 @@ def _handleRequest(self, context):
documentation_url=self._context.documentation_url,
)
else:
py_qgis_server = dict(found=False, version="not used")
qgis_server_meta = dict(found=False, version="not used")

data = {
# Only the "qgis_server" section is forwarded in LWC source code
Expand All @@ -172,7 +173,7 @@ def _handleRequest(self, context):
'commit_id': commit_id, # 288d2cacb5 if it's a dev version
'version_int': Qgis.QGIS_VERSION_INT, # 31600
},
'py_qgis_server': py_qgis_server,
'py_qgis_server': qgis_server_meta,
'external_providers_tos_checks': {
GOOGLE_KEY.lower(): strict_tos_check(GOOGLE_KEY),
BING_KEY.lower(): strict_tos_check(BING_KEY),
Expand Down

0 comments on commit 5278af6

Please sign in to comment.