NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

eveEdit_Parser.py (2413B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\control\eveEdit_Parser.py
      2 from carbonui.control.editutils.parserbase import ParserBaseCore
      3 
      4 class ParserBase(ParserBaseCore):
      5     __guid__ = 'eveparser.ParserBase'
      6     IMAGE_TYPES = {'icon',
      7      'corplogo',
      8      'typeicon',
      9      'factionlogo',
     10      'portrait',
     11      'starmap',
     12      'alliancelogo',
     13      'racelogo',
     14      'reward'}
     15 
     16     def OnStart_eve(self, attrs):
     17         what = getattr(attrs, 'type', None).strip().lower()
     18         if not what:
     19             return
     20         if what == 'charname' and session.charid:
     21             self.AddTextToBuffer(cfg.eveowners.Get(session.charid).name, fromW='eve')
     22         elif what == 'corpname' and session.corpid:
     23             self.AddTextToBuffer(cfg.eveowners.Get(session.corpid).name, fromW='eve')
     24         elif what == 'alliancename' and session.allianceid:
     25             self.AddTextToBuffer(cfg.eveowners.Get(session.allianceid).name, fromW='eve')
     26         elif what == 'solarsystemname' and (session.solarsystemid or session.solarsystemid2):
     27             self.AddTextToBuffer(cfg.evelocations.Get(session.solarsystemid or session.solarsystemid2).name, fromW='eve')
     28         elif what == 'constellationname' and session.constellationid:
     29             self.AddTextToBuffer(cfg.evelocations.Get(session.constellationid).name, fromW='eve')
     30         elif what == 'regionname' and session.regionid:
     31             self.AddTextToBuffer(cfg.evelocations.Get(session.regionid).name, fromW='eve')
     32         elif what == 'stationname' and session.stationid:
     33             self.AddTextToBuffer(cfg.evelocations.Get(session.stationid).name, fromW='eve')
     34 
     35     def OnStart_img_Game(self, attrs):
     36         imgType = attrs.src.split(':', 1)[0]
     37         if imgType in self.IMAGE_TYPES:
     38             tWidth = tHeight = int(getattr(attrs, 'size', 64))
     39             texture = None
     40             return (texture, tWidth, tHeight)
     41 
     42     def CheckForMailAddress(self, attrs):
     43         if hasattr(attrs, 'href') and attrs.href and attrs.href.startswith('evemail') and (hasattr(attrs, 'subject') or hasattr(attrs, 'message')) and attrs.href.count('::') < 2:
     44             attrs.href += '::' + getattr(attrs, 'subject', '') + '::' + getattr(attrs, 'message', '')
     45             attrs.href = attrs.href
     46 
     47 
     48 from carbonui.control.editutils.parserbase import ParserBaseCoreOverride
     49 ParserBaseCoreOverride.__bases__ = (ParserBase,)