Skip to content

Commit

Permalink
Provide the Git repository URL for each context
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Dec 10, 2024
1 parent 598d64a commit f0960a9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lizmap_server/context/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def name(self) -> str:
"""
...

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

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

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

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
4 changes: 4 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,10 @@ def __init__(self):
def name(self) -> str:
return SERVER_CONTEXT_NAME

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

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
4 changes: 4 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,10 @@ def _checkout(self, uri: str) -> Tuple[ProjectMetadata | CacheEntry, Co]:
def name(self) -> str:
return SERVER_CONTEXT_NAME

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

@property
def search_paths(self) -> List[str]:
""" Return search paths for projects
Expand Down
1 change: 1 addition & 0 deletions lizmap_server/server_info_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def _handleRequest(self, context):
build_id=server_metadata.build_id,
commit_id=server_metadata.commit_id,
stable=server_metadata.is_stable,
git_repository=self._context.git_repository,
)
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 f0960a9

Please sign in to comment.