App

The base App class.

class base_kivy_app.app.BaseKivyApp(**kw)

Bases: more_kivy_app.app.MoreKivyApp

The base app.

ask_cannot_close(*largs, **kwargs)

Called by kivy when the user tries to close the app. It only closes if this returns False.

This is only used when the app is started with run_app() or run_app_async().

check_close()

Returns whether the app can close now. Otherwise, a message telling the user it cannot close now with message _close_message will be shown.

error_indicator

The error indicator that gets the error reports. The app GUI should set error_indicator to the BaseKivyApp.graphics.ErrorIndicator instance used in the app abd it will be used to diplay errors and warnings.

filebrowser

Stores a instance of PopupBrowser that is automatically created by this app class. That class is described in base_kivy_app/graphics.kv.

init_load()

Creates any config files and adds data_path to the kivy resource PATH when the app is instantiated.

base_kivy_app.app.app_error(app_error_func=None, threaded=True)

A decorator which wraps the function in try…except and calls MoreKivyApp.handle_exception() when a exception is raised.

E.g.:

@app_error
def do_something():
    do_something
base_kivy_app.app.app_error_async(app_error_func=None, threaded=True)

A decorator which wraps the async function in try…except and calls MoreKivyApp.handle_exception() when a exception is raised.

E.g.:

@app_error
async def do_something():
    do_something
base_kivy_app.app.report_exception_in_app(e, exc_info=None, threaded=True)

Takes the error and reports it to MoreKivyApp.handle_exception().

Parameters
  • e – The error

  • exc_info – If not None, the return value of sys.exc_info() or a stringified version of it.

  • threaded – If the app should be called in a thread safe manner, e.g. if called from another thread.

base_kivy_app.app.run_app(cls_or_app)

Entrance method used to start the App. It runs, or instantiates and runs a MoreKivyApp type instance.

async base_kivy_app.app.run_app_async(cls_or_app)

Entrance method used to start the App. It runs, or instantiates and runs a MoreKivyApp type instance.