(self, cloned_from=None, cache=False, **kwargs)
| 496 | return ac |
| 497 | |
| 498 | def new_online_configuring_account(self, cloned_from=None, cache=False, **kwargs) -> Account: |
| 499 | if cloned_from is None: |
| 500 | configdict = self.get_next_liveconfig() |
| 501 | else: |
| 502 | # XXX we might want to transfer the key to the new account |
| 503 | configdict = { |
| 504 | "addr": cloned_from.get_config("addr"), |
| 505 | "mail_pw": cloned_from.get_config("mail_pw"), |
| 506 | "imap_certificate_checks": cloned_from.get_config("imap_certificate_checks"), |
| 507 | } |
| 508 | configdict.update(kwargs) |
| 509 | ac = self._get_cached_account(addr=configdict["addr"]) if cache else None |
| 510 | if ac is not None: |
| 511 | # make sure we consume a preconfig key, as if we had created a fresh account |
| 512 | self._preconfigured_keys.pop(0) |
| 513 | self._acsetup.add_configured(ac) |
| 514 | return ac |
| 515 | ac = self.prepare_account_from_liveconfig(configdict) |
| 516 | self._acsetup.start_configure(ac) |
| 517 | return ac |
| 518 | |
| 519 | def prepare_account_from_liveconfig(self, configdict) -> Account: |
| 520 | ac = self.get_unconfigured_account() |
no test coverage detected