New in version 1.1.0.
In case an application running with help from handle_errors_wrapper() (if running using main() with handle_errors=True) raises an exception outside of serving a HTTP transaction, Smisk will write (append) backtrace and error info to this file.
If not specified, the following path is used:
| Type: | string |
|---|---|
| Default: | None |
Returns an application instance.
application can be None, a subclass of smisk.core.Application or an instance of some kind of smisk.core.Application.
| Raises ValueError: | |
|---|---|
| if not possible. | |
| Return type: | smisk.core.Application |
Assures the SMISK_APP_DIR environment variable is set and points to the application directory.
If appdir is None, this function uses the following strategy for guessing the application directory:
appdir = os.path.dirname(sys.modules['__main__'].__file__)
Command Line Interface parser.
For instance, it’s used by smisk.mvc.main().
Command line arguments:
Call fnc catching any errors and writing information to error.log.
error.log will be written to, or appended to if it aldready exists, ENV["SMISK_LOG_DIR"]/error.log. If SMISK_LOG_DIR is not set, the file will be written to ENV["SMISK_APP_DIR"]/error.log. As a last resort ./error.log is used, in the case ENV["SMISK_APP_DIR"] is not present.
| Parameters: |
|
|---|---|
| Return type: | object |
Helper for setting up and running an application.
This function handles command line options, calls Application.setup() to set up the application, and then calls Application.run(), entering the runloop.
This is normally what you do in your top module __init__:
from smisk.mvc import main
if __name__ == '__main__':
main()
Your module is now a runnable program which automatically configures and runs your application.
Excessive arguments and keyword arguments are passed to Application.__init__(). If application is already an instance, these extra arguments and keyword arguments have no effect.
This function is not a true function, but rather an instance of Main.
| Parameters: |
|
|---|---|
| Returns: | Anything returned by Main.run() |
| See: |
Normally used through the common instance main().
Helper for setting up and running an application.
See documentation of main()
Helper for setting up an application.
*args and **kwargs are passed to absapp()
This function can only be called once. Successive calls simply returns the current application without making any modifications. If you want to update the application state, see Application.setup() instead, which can be called multiple times.
The application directory is the physical path in which your application module resides in the file system. Smisk need to know this and tries to automatically figure it out. However, there are cases where you need to explicitly define your application directory. For instance, if you’r calling main() or setup() from a sub-module of your application.
There are currently two ways of manually setting the application directory:
Environment variables
| Parameters: |
|
|---|---|
| Returns: | The application |
| Return type: | Application |
| See: |
Helper for running an application.
Note that because of the nature of libfcgi an application can not be started, stopped and then started again. That said, you can only start your application once per process. (Details: OS_ShutdownPending sets a process-wide flag causing any call to accept to bail out)
Environment variables
| Parameters: |
|
|---|---|
| Returns: | Anything returned by application.run() |
| Return type: | object |
| See: |