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

esiUtils.py (1246B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\common\script\util\esiUtils.py
      2 from __future__ import absolute_import
      3 from crimewatch.util import GetKillReportHashValue
      4 from .eveCommonUtils import CopyTextToClipboard
      5 from globalConfig.getFunctions import GetESIBaseUrl, GetESITenant
      6 
      7 def GetESIKillmailUrl(killmail):
      8     machoNet = sm.GetService('machoNet')
      9     baseUrl = GetESIBaseUrl(machoNet)
     10     tenant = GetESITenant(machoNet)
     11     killmailHash = GetKillReportHashValue(killmail)
     12     killmailUrl = '{baseUrl}/killmails/{id}/{hash}'.format(baseUrl=baseUrl, id=killmail.killID, hash=killmailHash)
     13     if tenant:
     14         killmailUrl += '/?tenant={}'.format(tenant)
     15     return killmailUrl
     16 
     17 
     18 def GetESIFleetUrl(fleetID):
     19     machoNet = sm.GetService('machoNet')
     20     baseUrl = GetESIBaseUrl(machoNet)
     21     tenant = GetESITenant(machoNet)
     22     fleetUrl = '{baseUrl}/fleets/{id}'.format(baseUrl=baseUrl, id=fleetID)
     23     if tenant:
     24         fleetUrl += '/?tenant={}'.format(tenant)
     25     return fleetUrl
     26 
     27 
     28 def CopyESIKillmailUrlToClipboard(killmail):
     29     url = GetESIKillmailUrl(killmail)
     30     CopyTextToClipboard(url)
     31 
     32 
     33 def CopyESIFleetUrlToClipboard(fleetID):
     34     url = GetESIFleetUrl(fleetID)
     35     CopyTextToClipboard(url)