当前位置: 首页>>代码示例>>Python>>正文


Python esi.Esi类代码示例

本文整理汇总了Python中service.esi.Esi的典型用法代码示例。如果您正苦于以下问题:Python Esi类的具体用法?Python Esi怎么用?Python Esi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Esi类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: delChar

 def delChar(self, event):
     item = self.lcCharacters.GetFirstSelected()
     if item > -1:
         charID = self.lcCharacters.GetItemData(item)
         sEsi = Esi.getInstance()
         sEsi.delSsoCharacter(charID)
         self.popCharList()
开发者ID:blitzmann,项目名称:Pyfa,代码行数:7,代码来源:esiFittings.py

示例2: populateSkillTree

    def populateSkillTree(self, data):
        if data is None:
            return
        root = self.root
        tree = self.fittingsTreeCtrl
        tree.DeleteChildren(root)

        sEsi = Esi.getInstance()

        dict = {}
        fits = data
        for fit in fits:
            if fit['fitting_id'] in sEsi.fittings_deleted:
                continue
            ship = getItem(fit['ship_type_id'])
            if ship is None:
                pyfalog.debug('Cannot find ship type id: {}'.format(fit['ship_type_id']))
                continue
            if ship.name not in dict:
                dict[ship.name] = []
            dict[ship.name].append(fit)

        for name, fits in dict.items():
            shipID = tree.AppendItem(root, name)
            for fit in fits:
                fitId = tree.AppendItem(shipID, fit['name'])
                tree.SetItemData(fitId, json.dumps(fit))

        tree.SortChildren(root)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:29,代码来源:esiFittings.py

示例3: __init__

    def __init__(self):
        mainFrame = gui.mainFrame.MainFrame.getInstance()

        wx.Dialog.__init__(self, mainFrame, id=wx.ID_ANY, title="SSO Login", size=wx.Size(400, 240))

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        text = wx.StaticText(self, wx.ID_ANY, "Copy and paste the block of text provided by pyfa.io, then click OK")
        bSizer1.Add(text, 0, wx.ALL | wx.EXPAND, 10)

        self.ssoInfoCtrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (-1, -1), style=wx.TE_MULTILINE)
        self.ssoInfoCtrl.SetFont(wx.Font(8, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL))
        self.ssoInfoCtrl.Layout()

        bSizer1.Add(self.ssoInfoCtrl, 1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)

        bSizer3 = wx.BoxSizer(wx.VERTICAL)
        bSizer3.Add(wx.StaticLine(self, wx.ID_ANY), 0, wx.BOTTOM | wx.EXPAND, 10)

        bSizer3.Add(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL), 0, wx.EXPAND)
        bSizer1.Add(bSizer3, 0, wx.ALL | wx.EXPAND, 10)

        self.SetSizer(bSizer1)
        self.Center()

        mainFrame.Bind(GE.EVT_SSO_LOGIN, self.OnLogin)

        from service.esi import Esi

        self.sEsi = Esi.getInstance()
        uri = self.sEsi.getLoginURI(None)
        webbrowser.open(uri)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:32,代码来源:ssoLogin.py

示例4: ShowSsoLogin

 def ShowSsoLogin(self, event):
     if getattr(event, "login_mode", LoginMethod.SERVER) == LoginMethod.MANUAL and getattr(event, "sso_mode", SsoMode.AUTO) == SsoMode.AUTO:
         dlg = SsoLogin(self)
         if dlg.ShowModal() == wx.ID_OK:
             sEsi = Esi.getInstance()
             # todo: verify that this is a correct SSO Info block
             sEsi.handleLogin({'SSOInfo': [dlg.ssoInfoCtrl.Value.strip()]})
开发者ID:petosorus,项目名称:Pyfa,代码行数:7,代码来源:mainFrame.py

示例5: updateEsiMenus

    def updateEsiMenus(self, type):
        menu = self.GetMenuBar()
        sEsi = Esi.getInstance()

        menu.SetLabel(menu.ssoLoginId, "Manage Characters")
        enable = len(sEsi.getSsoCharacters()) == 0
        menu.Enable(menu.eveFittingsId, not enable)
        menu.Enable(menu.exportToEveId, not enable)
开发者ID:petosorus,项目名称:Pyfa,代码行数:8,代码来源:mainFrame.py

示例6: updateCharList

    def updateCharList(self):
        sEsi = Esi.getInstance()
        chars = sEsi.getSsoCharacters()

        if len(chars) == 0:
            self.Close()

        self.charChoice.Clear()
        for char in chars:
            self.charChoice.Append(char.characterName, char.ID)

        self.charChoice.SetSelection(0)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:12,代码来源:esiFittings.py

示例7: popCharList

    def popCharList(self):
        sEsi = Esi.getInstance()
        chars = sEsi.getSsoCharacters()

        self.lcCharacters.DeleteAllItems()

        for index, char in enumerate(chars):
            self.lcCharacters.InsertItem(index, char.characterName)
            self.lcCharacters.SetItem(index, 1, str(char.characterID))
            self.lcCharacters.SetItemData(index, char.ID)

        self.lcCharacters.SetColumnWidth(0, wx.LIST_AUTOSIZE)
        self.lcCharacters.SetColumnWidth(1, wx.LIST_AUTOSIZE)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:13,代码来源:esiFittings.py

示例8: charChanged

    def charChanged(self, event):
        sChar = Character.getInstance()
        sEsi = Esi.getInstance()

        activeChar = self.charEditor.entityEditor.getActiveEntity()

        if event and event.EventType == GE.EVT_SSO_LOGIN.typeId and hasattr(event, 'character'):
            # Automatically assign the character that was just logged into
            sChar.setSsoCharacter(activeChar.ID, event.character.ID)

        sso = sChar.getSsoCharacter(activeChar.ID)

        self.fetchButton.Enable(sso is not None)

        ssoChars = sEsi.getSsoCharacters()

        self.charChoice.Clear()

        noneID = self.charChoice.Append("None", None)

        for char in ssoChars:
            currId = self.charChoice.Append(char.characterName, char.ID)

            if sso is not None and char.ID == sso.ID:
                self.charChoice.SetSelection(currId)

        if sso is None:
            self.charChoice.SetSelection(noneID)

        #
        # if chars:
        #     for charName in chars:
        #         self.charChoice.Append(charName)
        #     self.charChoice.SetStringSelection(char)
        # else:
        #     self.charChoice.Append("No characters...", 0)
        #     self.charChoice.SetSelection(0)
        #
        if activeChar.name in ("All 0", "All 5"):
            self.Enable(False)
            self.stDisabledTip.Show()
            self.Layout()
        else:
            self.Enable()
            self.stDisabledTip.Hide()
            self.Layout()

        if event is not None:
            event.Skip()
开发者ID:Sectoid,项目名称:Pyfa,代码行数:49,代码来源:characterEditor.py

示例9: deleteFitting

    def deleteFitting(self, event):
        sEsi = Esi.getInstance()
        selection = self.fitView.fitSelection
        if not selection:
            return
        data = json.loads(self.fitTree.fittingsTreeCtrl.GetItemData(selection))

        dlg = wx.MessageDialog(self,
                               "Do you really want to delete %s (%s) from EVE?" % (data['name'], getItem(data['ship_type_id']).name),
                               "Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)

        if dlg.ShowModal() == wx.ID_YES:
            try:
                sEsi.delFitting(self.getActiveCharacter(), data['fitting_id'])
                # repopulate the fitting list
                self.fitTree.populateSkillTree(self.fittings)
                self.fitView.update([])
            except requests.exceptions.ConnectionError:
                msg = "Connection error, please check your internet connection"
                pyfalog.error(msg)
                self.statusbar.SetStatusText(msg)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:21,代码来源:esiFittings.py

示例10: run

    def run(self):
        try:
            char = eos.db.getCharacter(self.charID)

            sEsi = Esi.getInstance()
            sChar = Character.getInstance()
            ssoChar = sChar.getSsoCharacter(char.ID)
            resp = sEsi.getSkills(ssoChar.ID)

            # 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?
            char.clearSkills()
            for skillRow in resp["skills"]:
                char.addSkill(Skill(char, skillRow["skill_id"], skillRow["trained_skill_level"]))

            resp = sEsi.getSecStatus(ssoChar.ID)

            char.secStatus = resp['security_status']

            self.callback[0](self.callback[1])
        except Exception as ex:
            pyfalog.warn(ex)
            self.callback[0](self.callback[1], sys.exc_info())
开发者ID:bsmr-eve,项目名称:Pyfa,代码行数:22,代码来源:character.py

示例11: fetchFittings

    def fetchFittings(self, event):
        sEsi = Esi.getInstance()
        waitDialog = wx.BusyInfo("Fetching fits, please wait...", parent=self)

        try:
            self.fittings = sEsi.getFittings(self.getActiveCharacter())
            # self.cacheTime = fittings.get('cached_until')
            # self.updateCacheStatus(None)
            # self.cacheTimer.Start(1000)
            self.fitTree.populateSkillTree(self.fittings)
            del waitDialog
        except requests.exceptions.ConnectionError:
            msg = "Connection error, please check your internet connection"
            pyfalog.error(msg)
            self.statusbar.SetStatusText(msg)
        except APIException as ex:
            #  Can't do this in a finally because then it obscures the message dialog
            del waitDialog  # noqa: F821
            ESIExceptionHandler(self, ex)
        except Exception as ex:
            del waitDialog  # noqa: F821
            raise ex
开发者ID:blitzmann,项目名称:Pyfa,代码行数:22,代码来源:esiFittings.py

示例12: exportFitting

    def exportFitting(self, event):
        sPort = Port.getInstance()
        fitID = self.mainFrame.getActiveFit()

        self.statusbar.SetStatusText("", 0)

        if fitID is None:
            self.statusbar.SetStatusText("Please select an active fitting in the main window", 1)
            return

        self.statusbar.SetStatusText("Sending request and awaiting response", 1)
        sEsi = Esi.getInstance()

        sFit = Fit.getInstance()
        data = sPort.exportESI(sFit.getFit(fitID))
        res = sEsi.postFitting(self.getActiveCharacter(), data)

        try:
            res.raise_for_status()
            self.statusbar.SetStatusText("", 0)
            self.statusbar.SetStatusText(res.reason, 1)
        except requests.exceptions.ConnectionError:
            msg = "Connection error, please check your internet connection"
            pyfalog.error(msg)
            self.statusbar.SetStatusText("ERROR", 0)
            self.statusbar.SetStatusText(msg, 1)
        except ESIExportException as ex:
            pyfalog.error(ex)
            self.statusbar.SetStatusText("ERROR", 0)
            self.statusbar.SetStatusText("{} - {}".format(res.status_code, res.reason), 1)
        except APIException as ex:
            try:
                ESIExceptionHandler(self, ex)
            except Exception as ex:
                self.statusbar.SetStatusText("ERROR", 0)
                self.statusbar.SetStatusText("{} - {}".format(res.status_code, res.reason), 1)
                pyfalog.error(ex)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:37,代码来源:esiFittings.py

示例13: addCharacter

 def addCharacter(self, event):
     sEsi = Esi.getInstance()
     sEsi.login()
开发者ID:Sectoid,项目名称:Pyfa,代码行数:3,代码来源:characterEditor.py

示例14: addChar

 def addChar(self, event):
     try:
         sEsi = Esi.getInstance()
         sEsi.login()
     except Exception as ex:
         ESIServerExceptionHandler(self, ex)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:6,代码来源:esiFittings.py


注:本文中的service.esi.Esi类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。