Skip to content

Commit

Permalink
Add desription, term of use and extract current version from changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledk2 committed Dec 31, 2024
1 parent d368bad commit abac322
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions omero_search_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@

from configurations.configuration import app_config as config_

def get_current_version():
current_version=""
file_name="CHANGELOG.md"
try:
with open(file_name) as f:
lines = f.readlines()
current_version=lines[0].split("(")[0]
except Exception as e:
pass
return current_version

template = {
"swaggerUiPrefix": LazyString(
Expand All @@ -47,12 +57,16 @@

search_omero_app.json_encoder = LazyJSONEncoder


search_omero_app.config["SWAGGER"] = {
"title": "OMERO Search Engine API",
"version": "0.2.0",
"version": str(get_current_version()),
'description': LazyString(lambda: 'OMERO search engine app is used to search metadata (key-value pairs).\n'
'For additional details, please refer to the following link:\n'
'https://github.com/ome/omero_search_engine/blob/main/README.rst'),
"termsOfService": "https://github.com/ome/omero_search_engine/blob/main/LICENSE.txt",
}


swagger = Swagger(search_omero_app, template=template)

app_config = load_configuration_variables_from_file(config_)
Expand Down

0 comments on commit abac322

Please sign in to comment.