(self, name='world')
| 170 | super(MyApp, self).__init__(*args) |
| 171 | |
| 172 | def main(self, name='world'): |
| 173 | self.login_manager = LoginManager(CookieInterface(self), 5) |
| 174 | self.login_manager.on_session_expired.do(self.on_logout) |
| 175 | |
| 176 | wid = gui.VBox(width=200, height=300, margin='0px auto') |
| 177 | btlogin = gui.Button('LOGIN') |
| 178 | btlogin.onclick.do(self.on_login) |
| 179 | btrenew = gui.Button('RENEW BEFORE EXPIRATION') |
| 180 | btrenew.onclick.do(self.on_renew) |
| 181 | |
| 182 | self.lblsession_status = gui.Label('NOT LOGGED IN') |
| 183 | |
| 184 | wid.append(btlogin) |
| 185 | wid.append(btrenew) |
| 186 | wid.append(self.lblsession_status) |
| 187 | |
| 188 | return wid |
| 189 | |
| 190 | def on_login(self, emitter): |
| 191 | self.login_manager.renew_session() |
nothing calls this directly
no test coverage detected