MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / importSkills

Method importSkills

gui/characterEditor.py:438–471  ·  view source on GitHub ↗
(self, evt)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 10

populateSkillTreeMethod · 0.95
fromClipboardFunction · 0.90
arabicOrRomanToIntFunction · 0.85
getActiveEntityMethod · 0.80
getSkillMethod · 0.80
btnRestrictMethod · 0.80
refreshEntityListMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
changeLevelMethod · 0.45

Tested by

no test coverage detected