Miscellaneous
Last updated
Last updated
Cement includes a Miscellaneous Utilities Module with helpers for common tasks that don't fit anywhere on their own.
API References:
The included is used to initialize a defaults dictionary for configuration settings and meta options.
When reading configuration files and other unknown data sources, we often need to convert strings to boolean. For example, a setting of true
read from a configparser text based config file will be a str
type, but we want it as an bool
.
The helper converts common true
values to boolean.
Cement provides a helper for use outside of the App
object, most notably for extensions (though they can use the application log also). This should only be used by the framework, or when the application log is not available (before application is setup maybe).
The helper is available when a random string is necessary, generally used for testing purposes.
When working with command lines, keeping output lines to less than 78 characters is a good best-practice. Cement provides the helper to accomplish this by adding a line break \n