samuraix.main provides with a setuptools entrypoint for the sx-wm console script.
The SamuraiLogger is a convenience logging.Logger subclass with additional functionalities to log exceptions nicer.
Improved exception logger.
| Parameter: | exc – An Exception instance |
|---|
Set up the logging for the client.
| Parameters: |
|
|---|
Tries to execute the Python configuration script. Returns its config member on success, None if there was an error reading the config file (e.g. if the file does not exist)
| Parameter: | configpath – The filename of the configuration script we should try to load. |
|---|---|
| Note: | Yes, the configuration file is a Python script, yes, it is executed and yes, that’s unsafe. Let’s trust the user that he knows what he does. |
First, it parses the options. If the user specified –default-config, it will just print the defaultconfig.py file and quit. If not, it configures the logging and loads the configuration. Then samuraix.app is set to an instance of app_func, or, if app_func is None, to an instance of samuraix.appl.App. After that, samuraix.appl.App.init() and samuraix.appl.App.run() are called.
| Parameter: | app_func – A callable returning an application instance and taking no arguments. If it is None, samuraix.appl.App will be used as fallback. |
|---|