hcoopmeetbotlogic.config

Plugin configuration and parsing.

Module Contents

hcoopmeetbotlogic.config.CONF_FILE = 'HcoopMeetbot.conf'
hcoopmeetbotlogic.config.CONF_SECTION = 'HcoopMeetbot'
hcoopmeetbotlogic.config.LOG_DIR_KEY = 'logDir'
hcoopmeetbotlogic.config.URL_PREFIX_KEY = 'urlPrefix'
hcoopmeetbotlogic.config.PATTERN_KEY = 'pattern'
hcoopmeetbotlogic.config.TIMEZONE_KEY = 'timezone'
hcoopmeetbotlogic.config.USE_CHANNEL_TOPIC_KEY = 'useChannelTopic'
hcoopmeetbotlogic.config.OUTPUT_FORMAT_KEY = 'outputFormat'
hcoopmeetbotlogic.config.LOG_DIR_DEFAULT
hcoopmeetbotlogic.config.URL_PREFIX_DEFAULT = '/'
hcoopmeetbotlogic.config.PATTERN_DEFAULT = '%Y/{name}.%Y%m%d.%H%M'
hcoopmeetbotlogic.config.TIMEZONE_DEFAULT = 'UTC'
hcoopmeetbotlogic.config.USE_CHANNEL_TOPIC_DEFAULT = False
class hcoopmeetbotlogic.config.OutputFormat

Bases: str, enum.Enum

Legal output formats.

HTML = 'HTML'
hcoopmeetbotlogic.config.OUTPUT_FORMAT_DEFAULT
class hcoopmeetbotlogic.config.Config

Configuration for the plugin.

conf_file

Path to the file where configuration was sourced from

Type:

Optional[str]

log_dir

Absolute path where meeting logs will be written

Type:

str

url_prefix

URL prefix to place on generated links to logfiles

Type:

str

pattern

Pattern for files generated in logFileDir

Type:

str

timezone

Timezone string, any value valid for pytz

Type:

str

use_channel_topic

Whether the bot should attempt to use the channel topic

Type:

bool

output_format

The output format to use

Type:

OutputFormat

conf_file: str | None
log_dir: str
url_prefix: str = '/'
pattern: str = '%Y/{name}.%Y%m%d.%H%M'
timezone: str = 'UTC'
use_channel_topic: bool = False
output_format: OutputFormat
hcoopmeetbotlogic.config.load_config(logger: logging.Logger | None, conf_path: str) Config

Load configuration from disk.

If conf_path is a directory, then HcoopMeetbot.conf will be loaded from that directory. If conf_path is a file, then that file will be loaded instead. If the entire file doesn’t exist, defaults will be used for all fields.

The configuration on disk may contain any or all of the configuration fields. A default (fallback) value will be used for any field that does not exist.

Parameters:
  • logger (Logger) – Python logger instance that should be used during processing

  • conf_path (str) – Limnoria bot config path to load configuration from, either a file or a directory