websauna.system.devop.scripts package

Command line scripts.

websauna.system.devop.scripts.display_deprecation_warning(script, config_uri)[source]

Display a deprecation message.

Parameters
  • script (str) – Name of the original Pyramid script.

  • config_uri (str) – URI for the configuration file.

websauna.system.devop.scripts.feedback(message, display_border=True)[source]

Display a feedback message on the console then exit.

Parameters

message (str) – Message to be displayed to the user.

Raises

sys.SystemExit

websauna.system.devop.scripts.feedback_and_exit(message, status_code=None, display_border=True)[source]

Display a feedback message on the console then exit.

Parameters
  • message (str) – Message to be displayed to the user.

  • status_code (Optional[int]) – Status code to be raised after displaying the message.

Raises

sys.SystemExit

websauna.system.devop.scripts.get_config_uri(argv)[source]

Return the config_uri from command line argv.

Parameters

argv (List[str]) – Sequence of command line string arguments.

Return type

str

Returns

config_uri, i.e: ws://websauna/conf/test.ini

websauna.system.devop.scripts.proxy_to_pyramid_script(script, argv)[source]

Proxy call to the original Pyramid script.

Parameters
  • script (str) – Name of the original Pyramid script.

  • argv (List[str]) – Command line arguments.

Raises

sys.SystemExit

websauna.system.devop.scripts.usage_message(argv, additional_params='', additional_line=None)[source]

Display usage message and exit.

Parameters
  • argv (List[str]) – Command line arguments.

  • additional_params (str) – Additional parameters to be displayed. i.e.: [var=value].

  • additional_line (Optional[str]) – Additional line to be added to the end of the message. i.e.: [var=value].

Raises

sys.SystemExit