Package webinterface

webinterface.common

common.py

Helper functions for the graphical user interface of mercure.

async webinterface.common.async_run(cmd, **params) Tuple[Optional[int], bytes, bytes][source]

Executes the given command in a way compatible with ayncio.

webinterface.common.get_user_information(request) dict[source]

Returns dictionary of values that should always be passed to the templates when the user is logged in.

webinterface.modules

modules.py

Modules page for the graphical user interface of mercure.

async webinterface.modules.add_module(request)[source]

Creates a new routing rule and forwards the user to the rule edit page.

async webinterface.modules.delete_module(request)[source]

Creates a new routing rule and forwards the user to the rule edit page.

async webinterface.modules.edit_module(request)[source]

Shows all installed modules

async webinterface.modules.edit_module_POST(request)[source]

Creates a new routing rule and forwards the user to the rule edit page.

async webinterface.modules.save_module(form, name) starlette.responses.Response[source]

We already read the config by this time

async webinterface.modules.show_modules(request)[source]

Shows all installed modules

webinterface.queue

queue.py

Queue page for the graphical user interface of mercure.

async webinterface.queue.set_queues_status(request)[source]
async webinterface.queue.show_jobs_fail(request)[source]
async webinterface.queue.show_jobs_processing(request)[source]
async webinterface.queue.show_jobs_routing(request)[source]
async webinterface.queue.show_jobs_studies(request)[source]
async webinterface.queue.show_queues(request)[source]

Shows all installed modules

async webinterface.queue.show_queues_status(request)[source]

webinterface.rules

rules.py

Rules page for the graphical user interface of mercure.

async webinterface.rules.add_rule(request) starlette.responses.Response[source]

Creates a new routing rule and forwards the user to the rule edit page.

async webinterface.rules.rules_delete_post(request) starlette.responses.Response[source]

Deletes the given routing rule

async webinterface.rules.rules_edit(request) starlette.responses.Response[source]

Shows the edit page for the given routing rule.

async webinterface.rules.rules_edit_post(request) starlette.responses.Response[source]

Updates the settings for the given routing rule.

async webinterface.rules.rules_test(request) starlette.responses.Response[source]

Evalutes if a given routing rule is valid. The rule and testing dictionary have to be passed as form parameters.

async webinterface.rules.rules_test_completionseries(request) starlette.responses.Response[source]

Evalutes if a given value for the series list for study completion is valid.

async webinterface.rules.show_rules(request) starlette.responses.Response[source]

Show all defined routing rules. Can be executed by all logged-in users.

webinterface.services

services.py

Helper functions for controlling the services from the graphical user interface of mercure.

webinterface.services.read_services() None[source]

Reads the list of configured services from the configuration file. This list normally does not have to be changed, but can be modified if multiple instances of individual services should be used to increase performance.

webinterface.tagslist

tagslist.py

Helper functions for displaying a list of DICOM tags available for routing in the graphical user interface of mercure.

webinterface.tagslist.read_tagslist() None[source]

Reads the list of supported DICOM tags with example values. This list is parsed from the C code of the getseqparam module.

webinterface.targets

targets.py

Targets page for the graphical user interface of mercure.

async webinterface.targets.add_target(request) starlette.responses.Response[source]

Creates a new target.

async webinterface.targets.show_targets(request) starlette.responses.Response[source]

Shows all configured targets.

async webinterface.targets.targets_delete_post(request) starlette.responses.Response[source]

Deletes the given target.

async webinterface.targets.targets_edit(request) starlette.responses.Response[source]

Shows the edit page for the given target.

async webinterface.targets.targets_edit_post(request) Union[starlette.responses.RedirectResponse, starlette.responses.PlainTextResponse][source]

Updates the given target using the form values posted with the request.

async webinterface.targets.targets_test_post(request) starlette.responses.Response[source]

Tests the connectivity of the given target by executing ping and c-echo requests.

webinterface.users

users.py

Users page and user support functions for the graphical user interface of mercure.

class webinterface.users.User(*args, **kwargs)[source]

Bases: dict

change_password: typing_extensions.Literal['True', 'False']
email: str
is_admin: typing_extensions.Literal['True', 'False']
password: str
permissions: Any
async webinterface.users.add_new_user(request) starlette.responses.Response[source]

Creates a new user and redirects to the user-edit page.

webinterface.users.create_users() Dict[str, webinterface.users.User][source]

Create new users file and create seed admin account with name “admin” and password “router”.

webinterface.users.evaluate_password(username, password) bool[source]

Check if the given password for the given user is correct. Hashed passwords are stored with salt.

webinterface.users.hash_password(password) str[source]

Hash the password using the passlib library.

webinterface.users.is_admin(username) bool[source]

Check in the user list if the given user has admin rights.

webinterface.users.needs_change_password(username) bool[source]

Check if the given user has to change his password after login.

webinterface.users.read_users() Dict[str, webinterface.users.User][source]

Reads the user list from the configuration file. The file will only be read if it has been updated since the last function call. If the file does not exist, create a new user file.

webinterface.users.save_users() None[source]

Write the users list into a file on the disk.

async webinterface.users.show_users(request) starlette.responses.Response[source]

Shows all available users.

async webinterface.users.users_delete_post(request) starlette.responses.Response[source]

Deletes the given users.

async webinterface.users.users_edit(request) starlette.responses.Response[source]

Shows the settings for a given user.

async webinterface.users.users_edit_post(request) starlette.responses.Response[source]

Updates the given user with settings passed as form parameters.