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

Provide the Git repository and documentation URL for each context #100

Merged
merged 1 commit into from
Jan 6, 2025
Merged
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
14 changes: 14 additions & 0 deletions lizmap_server/context/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ def name(self) -> str:
"""
...

@property
@abstractmethod
def git_repository_url(self) -> str:
""" Return Git repository URL
"""
...

@property
@abstractmethod
def documentation_url(self) -> str:
""" Return documentation URL
"""
...

@property
@abstractmethod
def search_paths(self) -> List[str]:
Expand Down
8 changes: 8 additions & 0 deletions lizmap_server/context/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class Context(ContextABC):
def name(self) -> str:
return SERVER_CONTEXT_NAME

@property
def git_repository_url(self) -> str:
return "https://github.com/qgis/QGIS"

@property
def documentation_url(self) -> str:
return "https://docs.qgis.org/latest/en/docs/server_manual/"

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
8 changes: 8 additions & 0 deletions lizmap_server/context/py_qgis_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ def __init__(self):
def name(self) -> str:
return SERVER_CONTEXT_NAME

@property
def git_repository_url(self) -> str:
return "https://github.com/3liz/py-qgis-server"

@property
def documentation_url(self) -> str:
return "https://docs.3liz.org/py-qgis-server/"

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
8 changes: 8 additions & 0 deletions lizmap_server/context/py_qgis_server2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def _checkout(self, uri: str) -> Tuple[ProjectMetadata | CacheEntry, Co]:
def name(self) -> str:
return SERVER_CONTEXT_NAME

@property
def git_repository_url(self) -> str:
return "https://github.com/3liz/py-qgis-server2"

@property
def documentation_url(self) -> str:
return ""

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
2 changes: 2 additions & 0 deletions lizmap_server/server_info_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def _handleRequest(self, context):
build_id=server_metadata.build_id,
commit_id=server_metadata.commit_id,
stable=server_metadata.is_stable,
git_repository_url=self._context.git_repository_url,
documentation_url=self._context.documentation_url,
)
else:
py_qgis_server = dict(found=False, version="not used")
Expand Down
1 change: 1 addition & 0 deletions test/test_server_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_lizmap_server_info(client):
assert json_content['qgis_server']['plugins'][plugin]['version'] == 'Not found'

assert len(json_content['qgis_server']['fonts']) >= 1
assert len(json_content['qgis_server'].get('py_qgis_server').keys()) >= 2


def test_tos_checks(client):
Expand Down
Loading