+ showlvl = ShowLevels(cmdArgs.show)
+ if showlvl != ShowLevels.ONEXTERNAL and situation.lastSetup:
+ # use last config
+ setup = situation.lastSetup
+ elif showlvl == ShowLevels.ONERROR:
+ # guess config
+ setup = screen.ScreenSetup(situation.internalResolutions()[0], situation.externalResolutions()[0], screen.RelativeScreenPosition.RIGHT)
+ # TODO make default relative position configurable in the config file
+ # TODO this has a bit of code duplication with the cmdArgs method above
+ else:
+ # ask the user
+ setup = frontend.setup(situation)
+ if setup is None: sys.exit(1) # the user canceled
+ with database.Database(databaseFilePath) as db:
+ situation.putDBInfo(db, setup)