csaxs_bec.bec_ipython_client.plugins.flomni.flomni_webpage_generator.WebpageGeneratorBase#

class WebpageGeneratorBase(bec_client, output_dir: str = '~/data/raw/webpage/', cycle_interval: float = 15, verbosity: int = 1, upload_url: str = None, local_port: int = 8080)[source]#

Bases: object

Common webpage generator. Subclass and override:

_collect_setup_data() – return dict of instrument-specific data _logo_path() – return Path to logo PNG, or None for text fallback

Methods

set_web_password

Set the web password for the current BEC account.

start

Start the generator.

status

Print a human-readable status summary to the console.

stop

Stop the generator thread, local HTTP server, and release the singleton lock.

Attributes

verbosity

set_web_password(password: str) None[source]#

Set the web password for the current BEC account.

Sends the plaintext password to set_password.php on the server (IP-restricted, HTTPS). PHP generates the bcrypt hash and writes session.htpasswd directly — no Python bcrypt package needed.

The username is taken from bec.active_account (e.g. ‘p23092’).

Example::

flomni.webpage_gen.set_web_password(“my_secret_password”)

start() None[source]#

Start the generator.

If this session already holds the thread, does nothing. If another session holds a fresh lock, a background watcher thread is launched that polls every 3 s and takes over as soon as the lock goes stale — no blocking, no second call to start() needed. Progress messages during the wait are printed at verbosity >= 2 only.

status() None[source]#

Print a human-readable status summary to the console.

stop() None[source]#

Stop the generator thread, local HTTP server, and release the singleton lock.