(self, evt)
| 436 | event.Skip() |
| 437 | |
| 438 | def importSkills(self, evt): |
| 439 | |
| 440 | with wx.MessageDialog( |
| 441 | self, (_t("Importing skills into this character will set the skill levels as pending. To save the skills " |
| 442 | "permanently, please click the Save button at the bottom of the window after importing")), |
| 443 | _t("Import Skills"), wx.OK |
| 444 | ) as dlg: |
| 445 | dlg.ShowModal() |
| 446 | |
| 447 | text = fromClipboard().strip() |
| 448 | if text: |
| 449 | sCharacter = Character.getInstance() |
| 450 | char = self.charEditor.entityEditor.getActiveEntity() |
| 451 | try: |
| 452 | lines = text.splitlines() |
| 453 | |
| 454 | for l in lines: |
| 455 | s = l.strip() |
| 456 | skill, level = s.rsplit(None, 1)[0], arabicOrRomanToInt(s.rsplit(None, 1)[1]) |
| 457 | skill = char.getSkill(skill) |
| 458 | if skill: |
| 459 | sCharacter.changeLevel(char.ID, skill.item.ID, level) |
| 460 | |
| 461 | except (KeyboardInterrupt, SystemExit): |
| 462 | raise |
| 463 | except Exception as e: |
| 464 | pyfalog.error(e) |
| 465 | with wx.MessageDialog(self, _t("There was an error importing skills, please see log file"), _t("Error"), wx.ICON_ERROR) as dlg: |
| 466 | dlg.ShowModal() |
| 467 | |
| 468 | finally: |
| 469 | self.charEditor.btnRestrict() |
| 470 | self.populateSkillTree() |
| 471 | self.charEditor.entityEditor.refreshEntityList(char) |
| 472 | |
| 473 | def exportSkills(self, evt): |
| 474 | char = self.charEditor.entityEditor.getActiveEntity() |
nothing calls this directly
no test coverage detected