- ScreenList::iterator it, end = _screens.end();
-
- // run the user's script or the system defaults if that fails
- bool pyerr, doretry;
- do {
- // initialize scripting
- python_init(argv[0]);
-
- // load all of the screens' configs here so we have a theme set if
- // we decide to show the dialog below
- for (it = _screens.begin(); it != end; ++it)
- (*it)->config().load(); // load the defaults from config.py
-
- pyerr = doretry = false;
-
- // reset all the python stuff
- _bindings->removeAllKeys();
- _bindings->removeAllButtons();
- _bindings->removeAllEvents();
-
- int ret = python_exec(_scriptfilepath.c_str());
- if (ret == 2)
- pyerr = true;
-
- if (ret) {
- // reset all the python stuff
- _bindings->removeAllKeys();
- _bindings->removeAllButtons();
- _bindings->removeAllEvents();
-
- if (python_exec(SCRIPTDIR"/defaults.py")) // system default bahaviors
- pyerr = true;
- }