(self)
| 498 | self.running = True |
| 499 | |
| 500 | def run(self): |
| 501 | try: |
| 502 | char = eos.db.getCharacter(self.charID) |
| 503 | |
| 504 | sEsi = Esi.getInstance() |
| 505 | sChar = Character.getInstance() |
| 506 | ssoChar = sChar.getSsoCharacter(char.ID) |
| 507 | |
| 508 | if not self.running: |
| 509 | self.callback[0](self.callback[1]) |
| 510 | return |
| 511 | resp = sEsi.getSkills(ssoChar.ID) |
| 512 | |
| 513 | if not self.running: |
| 514 | self.callback[0](self.callback[1]) |
| 515 | return |
| 516 | # todo: check if alpha. if so, pop up a question if they want to apply it as alpha. Use threading events to set the answer? |
| 517 | char.clearSkills() |
| 518 | for skillRow in resp["skills"]: |
| 519 | char.addSkill(Skill(char, skillRow["skill_id"], skillRow["trained_skill_level"])) |
| 520 | |
| 521 | if not self.running: |
| 522 | self.callback[0](self.callback[1]) |
| 523 | return |
| 524 | resp = sEsi.getSecStatus(ssoChar.ID) |
| 525 | char.secStatus = resp['security_status'] |
| 526 | self.callback[0](self.callback[1]) |
| 527 | except (KeyboardInterrupt, SystemExit): |
| 528 | raise |
| 529 | except Exception as ex: |
| 530 | pyfalog.warn(ex) |
| 531 | self.callback[0](self.callback[1], sys.exc_info()) |
| 532 | |
| 533 | def stop(self): |
| 534 | self.running = False |
nothing calls this directly
no test coverage detected