Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change 'py-qgis-server2' support to 'qjazz' support #101

Merged
merged 1 commit into from
Jan 6, 2025
Merged
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
Change 'py-qgis-server2' support to 'qjazz' support
dmarteau committed Jan 6, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b2d7367158f69a3c0fd7537ffa13aea8c0f83429
4 changes: 2 additions & 2 deletions lizmap_server/context/__init__.py
Original file line number Diff line number Diff line change
@@ -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]

Original file line number Diff line number Diff line change
@@ -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

@@ -18,7 +18,7 @@
)


SERVER_CONTEXT_NAME = 'py-qgis-server2'
SERVER_CONTEXT_NAME = 'qjazz'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I guess L40 and L44 will be updated later ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes



class Context(ContextABC):
@@ -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,
7 changes: 4 additions & 3 deletions lizmap_server/server_info_handler.py
Original file line number Diff line number Diff line change
@@ -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,
@@ -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
@@ -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),