2. Initialization API
This document describes the IVE_TANIM initialization API, which initializes the configuration settings for the custom logger and initializes the IVE_TANIM configuration file, which is JSON file that lives in ~/.config/ive_tanim/config.json.
The logger has a custom format: '%(levelname)s %(module)s.%(funcName)s (%(lineno)d): %(message)s'. See the logging cookbook for more information on what this format means.
Some of the Core Functionality command line tools have an extra argument flag, --level, that specifies whether to print out logging output and the following debug levels: DEBUG, INFO, or ERROR.
- ive_tanim.baseConfDir = '/home/tanim/.config/ive_tanim'
the directory where
IVE_TANIMuser data is stored –~/.config/ive_tanim.
- ive_tanim.configFile = '/home/tanim/.config/ive_tanim/config.json'
The configuration file location of
IVE_TANIMconfiguration data –~/.config/ive_tanim/config.json.
- ive_tanim.create_config()
Creates the necessary JSON configuration file into
~/.config/ive_tanim/config.json, AND to create the~/.config/ive_tanimif not there. The configuration file contains three empty keys by default.mewith an empty string “” value.aliaseswith an emptydictvalue.smtpwith adictdescribing a default SMTP server.{ 'server' : 'localhost', 'port' : 25 }
Useful methods in
rst2htmlwill do the following:Set the default sender (owned by the
mekey).Add aliases (key-value pairs into the
dictowned by the thealiaseskey).Set the default SMTP server settings (changing the
servername and changing the default port).