| 102 | |
| 103 | |
| 104 | class StandaloneApplication(BaseApplication): |
| 105 | def __init__(self, app, options=None): |
| 106 | self.application = app |
| 107 | self.options = options or {} |
| 108 | super().__init__() |
| 109 | |
| 110 | def load_config(self): |
| 111 | config = {key: value for key, value in self.options.items() if key in self.cfg.settings and value is not None} |
| 112 | for key, value in config.items(): |
| 113 | self.cfg.set(key.lower(), value) |
| 114 | |
| 115 | def load(self): |
| 116 | return self.application |
| 117 | |
| 118 | |
| 119 | def load_engine(): |