Skip to content

Commit

Permalink
Merge pull request #100 from Gustry/git_repository
Browse files Browse the repository at this point in the history
Provide the Git repository and documentation URL for each context
  • Loading branch information
Gustry authored Jan 6, 2025
2 parents 88290db + bb5d229 commit f1178fe
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
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

0 comments on commit f1178fe

Please sign in to comment.