Example #1
0
    def GetHeaderValues(self):
        viewType = self.sr.viewType
        if viewType == VIEW_TITLES:
            header = [
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/CorpMemberName'
                ),
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/CorpMemberBase')
            ]
            for title in sorted(sm.GetService('corp').GetTitles().itervalues(),
                                key=lambda x: x.titleID):
                header.append(title.titleName)

        else:
            roleGroup = self.sr.roleGroupings[self.sr.viewRoleGroupingID]
            header = [
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/CorpMemberName'
                ),
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/CorpMemberBase')
            ]
            for column in roleGroup.columns:
                columnName, subColumns = column
                colName = uiutil.ReplaceStringWithTags(columnName)
                header.append(colName)

        return header
    def GetHeaderValues(self, roleGroupingID):
        roleGroup = self.sr.roleGroupings[roleGroupingID]
        headers = [
            localization.GetByLabel(
                'UI/Corporations/CorporationWindow/Members/CorpMemberName')
        ]
        for column in roleGroup.columns:
            columnName, subColumns = column
            colName = uiutil.ReplaceStringWithTags(columnName)
            headers.append(colName)

        return headers
    def LoadData(self):
        self.services = self.corpStationMgr.GetStationServiceIdentifiers()
        self.servicesByID = {}
        self.serviceAccessRulesByServiceID = {}
        self.modifiedServiceAccessRulesByServiceID = {}
        self.modifiedServiceCostModifiers = []
        self.modifiedRentableItems = []
        serviceMask = self.GetStationServiceMask()
        for service in self.services:
            if not self.IsActiveService(service.serviceID):
                continue
            if service.serviceID == serviceMask & service.serviceID:
                self.servicesByID[service.serviceID] = service
                serviceAccessRule = self.corpStationMgr.GetStationServiceAccessRule(eve.session.stationid, service.serviceID)
                self.serviceAccessRulesByServiceID[service.serviceID] = serviceAccessRule
                log.LogInfo('serviceAccessRule:', serviceAccessRule)

        self.serviceCostModifiers = self.corpStationMgr.GetStationManagementServiceCostModifiers(eve.session.stationid)
        self.station = self.corpStationMgr.GetStationDetails(eve.session.stationid)
        orbitName = cfg.evelocations.Get(self.station.orbitID).GetRawName(localization.const.LOCALE_SHORT_ENGLISH)
        if self.station.stationName.startswith(orbitName):
            orbitNameStripped = uiutil.StripTags(orbitName)
            orbitNameStripped += ' - '
            self.station.stationName = uiutil.ReplaceStringWithTags(self.station.stationName, old=orbitNameStripped, new='')
        if self.station.description is None:
            self.station.description = ''
        log.LogInfo('GetStationDetails:', self.station)
        rentableItems = self.corpStationMgr.GetRentableItems()
        self.rentableItems = []
        for rentableItem in rentableItems:
            self.rentableItems.append(rentableItem)
            log.LogInfo('RentableItem:', rentableItem)

        self.rentableItems.sort(lambda x, y: -cmp(y.number, x.number))
        owners = []
        for each in self.rentableItems:
            if each.typeID != const.typeOfficeFolder:
                continue
            if each.rentedToID is not None and each.rentedToID not in owners:
                owners.append(each.rentedToID)

        if len(owners):
            cfg.eveowners.Prime(owners)
Example #4
0
    def GetCompareTypeInfoContentList(self):
        scrolllist = []
        headers, uniqueHeaders, treatedHeaders, initialHeaders = ([], [], [],
                                                                  [])
        if self.typeIDs:
            headers = [
                localization.GetByLabel('/Carbon/UI/Common/TypeName'),
                localization.GetByLabel('UI/Compare/MetaGroup')
            ]
            for typeRow in self.typeIDs:
                data = typeRow.copy()
                typeName = evetypes.GetName(typeRow.invtype)
                metaGroup = sm.GetService('info').GetMetaTypesFromTypeID(
                    typeRow.invtype, groupOnly=1)
                text = '%s<t>%s' % (typeName, metaGroup.metaGroupName)
                data.Set('sort_%s' % headers[0], typeName)
                data.Set('sort_%s' % headers[1], metaGroup.metaGroupID)
                attributeLoop = {}
                for each in self.attrDict:
                    if each.attributeID in self.attrDictChecked:
                        attributeLoop[each.attributeID] = each

                for each in self.attrDictIDs:
                    attribute = attributeLoop.get(each, None)
                    if not attribute:
                        continue
                    displayName = uiutil.ReplaceStringWithTags(
                        attribute.displayName)
                    value = None
                    if (displayName,
                            attribute.attributeID) not in uniqueHeaders:
                        uniqueHeaders.append(
                            (displayName, attribute.attributeID))
                    if attribute.attributeID == const.attributeBaseWarpSpeed:
                        GTA = sm.GetService('godma').GetTypeAttribute
                        typeID = typeRow.invtype
                        cmp = max(
                            GTA(typeID,
                                const.attributeBaseWarpSpeed,
                                defaultValue=1), 1.0)
                        cmp *= GTA(typeID,
                                   const.attributeWarpSpeedMultiplier,
                                   defaultValue=1)
                        cmp *= const.AU
                        value = cmp
                        taa = sm.GetService('info').GetBaseWarpSpeed(
                            typeRow.invtype)
                    else:
                        taa, value = self.GetAttributeValue(
                            attribute, typeRow.invtype)
                    if evetypes.GetCategoryID(
                            typeRow.invtype) == const.categoryCharge:
                        bsd, bad = sm.GetService('info').GetBaseDamageValue(
                            typeRow.invtype)
                        if attribute.displayName == localization.GetByLabel(
                                'UI/Compare/BaseShieldDamage'):
                            value = bsd[0]
                        elif attribute.displayName == localization.GetByLabel(
                                'UI/Compare/BaseArmorDamage'):
                            value = bad[0]
                    if value is not None:
                        data.Set('sort_%s' % displayName, value)
                    else:
                        data.Set('sort_%s' % displayName, taa)
                    if taa is None:
                        taa = localization.GetByLabel(
                            'UI/Generic/NotAvailableShort')
                    else:
                        taa = GetFormatAndValue(attribute, taa)
                    text += '<t>%s' % taa

                data.label = text
                data.getIcon = 1
                data.GetMenu = self.GetEntryMenu
                data.viewMode = 'details'
                data.ignoreRightClick = 1
                scrolllist.append(listentry.Get('Item', data=data))

            for header, attributeID in uniqueHeaders:
                if header in headers:
                    header = header + ' '
                headers.append(header)

            initialHeaders = headers
            treatedHeaders = []
            for each in initialHeaders:
                treatedHeaders.append(each.replace(' ', '<br>'))

        return (scrolllist, initialHeaders)