本文整理汇总了Python中messenger.ext.passCensor函数的典型用法代码示例。如果您正苦于以下问题:Python passCensor函数的具体用法?Python passCensor怎么用?Python passCensor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了passCensor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, cfdUnitID, unitMgrID = 0, cmdrRating = 0, peripheryID = 0, unit = None, **kwargs):
super(UnitsListItem, self).__init__()
playersCount = 0
commandSize = 0
state = 0
isRosterSet = False
creator = None
description = None
if unit:
creator = unit.getCreator()
if creator is not None:
creator = PlayerUnitInfo(unit.getCreatorDBID(), cfdUnitID, unit, **creator)
freeSlots = unit.getFreeSlots()
playersSlots = unit.getPlayerSlots()
state = unit.getState()
playersCount = len(playersSlots)
commandSize = len(playersSlots) + len(freeSlots)
isRosterSet = unit.isRosterSet(ignored=CREATOR_ROSTER_SLOT_INDEXES)
description = passCensor(unit.getComment())
self.cfdUnitID = cfdUnitID
self.unitMgrID = unitMgrID
self.creator = creator
self.rating = cmdrRating
self.peripheryID = peripheryID
self.playersCount = playersCount
self.commandSize = commandSize
self.state = UnitState(state)
self.isRosterSet = isRosterSet
self.description = description
return
示例2: __showSettings
def __showSettings(self, functional):
settings = functional.getSettings()
if settings is None:
return
else:
isCreator = functional.isCreator()
permissions = functional.getPermissions()
arenaTypeID = settings['arenaTypeID']
arenaType = ArenaType.g_cache.get(arenaTypeID)
if isCreator:
comment = settings['comment']
else:
comment = passCensor(settings['comment'])
self.as_setInfoS({'isCreator': isCreator,
'creator': settings[PREBATTLE_SETTING_NAME.CREATOR],
'title': formatters.getTrainingRoomTitle(arenaType),
'arenaName': arenaType.name,
'arenaTypeID': arenaTypeID,
'arenaSubType': formatters.getArenaSubTypeString(arenaTypeID),
'description': arenaType.description,
'maxPlayersCount': arenaType.maxPlayersInTeam * 2,
'roundLenString': formatters.getRoundLenString(settings['roundLength']),
'comment': comment,
'arenaVoipChannels': settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
'canChangeArenaVOIP': permissions.canChangeArenaVOIP()})
return
示例3: update
def update(self, cmdrRating = 0, unit = None, **kwargs):
self.rating = cmdrRating
if unit:
creatorDBID = unit.getCreatorDBID()
if self.creator.dbID != creatorDBID:
isChanged = True
data = unit.getCreator()
if data:
self.creator = PlayerUnitInfo(creatorDBID, self.cfdUnitID, unit, **data)
else:
self.creator = None
self.state = UnitState(unit.getState())
freeSlots = unit.getFreeSlots()
playersSlots = unit.getPlayerSlots()
self.playersCount = len(playersSlots)
self.commandSize = len(playersSlots) + len(freeSlots)
self.isRosterSet = unit.isRosterSet(ignored=CREATOR_ROSTER_SLOT_INDEXES)
self.description = passCensor(unit.getComment())
else:
self.creator = None
self.playersCount = 0
self.commandSize = 0
self.state = UnitState(0)
self.isRosterSet = False
self.description = None
return
示例4: onSettingUpdated
def onSettingUpdated(self, functional, settingName, settingValue):
if settingName == PREBATTLE_SETTING_NAME.DIVISION:
if not functional.isCreator():
self.as_setDivisionS(settingValue)
elif settingName == PREBATTLE_SETTING_NAME.IS_OPENED:
if not functional.isCreator():
self.as_setOpenedS(settingValue)
elif settingName == PREBATTLE_SETTING_NAME.COMMENT:
if not functional.isCreator():
self.as_setCommentS(passCensor(settingValue))
elif settingName == PREBATTLE_SETTING_NAME.LIMITS:
self.__setLimits(functional.getRosters(), functional.getSettings().getTeamLimits(1))
示例5: __showSettings
def __showSettings(self, functional):
settings = functional.getSettings()
if settings is None:
return
isCreator = functional.isCreator()
permissions = functional.getPermissions()
arenaTypeID = settings["arenaTypeID"]
arenaType = ArenaType.g_cache.get(arenaTypeID)
if isCreator:
comment = settings["comment"]
else:
comment = passCensor(settings["comment"])
creatorFullName, creatorClan, creatorRegion, creatorIgrType = (None, None, None, 0)
creator = self.__getCreatorFromRosters()
if creator:
creatorFullName = creator.getFullName()
creatorClan = creator.clanAbbrev
creatorRegion = g_lobbyContext.getRegionCode(creator.dbID)
creatorIgrType = creator.igrType
self.as_setInfoS(
{
"isCreator": isCreator,
"creator": settings[PREBATTLE_SETTING_NAME.CREATOR],
"creatorFullName": creatorFullName,
"creatorClan": creatorClan,
"creatorRegion": creatorRegion,
"creatorIgrType": creatorIgrType,
"title": formatters.getTrainingRoomTitle(arenaType),
"arenaName": arenaType.name,
"arenaTypeID": arenaTypeID,
"arenaSubType": formatters.getArenaSubTypeString(arenaTypeID),
"description": arenaType.description,
"maxPlayersCount": arenaType.maxPlayersInTeam * 2,
"roundLenString": formatters.getRoundLenString(settings["roundLength"]),
"comment": comment,
"arenaVoipChannels": settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
"canChangeArenaVOIP": permissions.canChangeArenaVOIP(),
"isObserverModeEnabled": self.__isObserverModeEnabled(),
}
)
示例6: __showSettings
def __showSettings(self, functional):
settings = functional.getSettings()
if settings is None:
return
else:
isCreator = functional.isCreator()
permissions = functional.getPermissions()
arenaTypeID = settings['arenaTypeID']
arenaType = ArenaType.g_cache.get(arenaTypeID)
if isCreator:
comment = settings['comment']
else:
comment = passCensor(settings['comment'])
creatorFullName, creatorClan, creatorRegion, creatorIgrType = (None, None, None, 0)
creator = self.__getCreatorFromRosters()
if creator:
creatorFullName = creator.getFullName()
creatorClan = creator.clanAbbrev
creatorRegion = g_lobbyContext.getRegionCode(creator.dbID)
creatorIgrType = creator.igrType
self.as_setInfoS({'isCreator': isCreator,
'creator': settings[PREBATTLE_SETTING_NAME.CREATOR],
'creatorFullName': creatorFullName,
'creatorClan': creatorClan,
'creatorRegion': creatorRegion,
'creatorIgrType': creatorIgrType,
'title': formatters.getTrainingRoomTitle(arenaType),
'arenaName': arenaType.name,
'arenaTypeID': arenaTypeID,
'arenaSubType': formatters.getArenaSubTypeString(arenaTypeID),
'description': arenaType.description,
'maxPlayersCount': arenaType.maxPlayersInTeam * 2,
'roundLenString': formatters.getRoundLenString(settings['roundLength']),
'comment': comment,
'arenaVoipChannels': settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
'canChangeArenaVOIP': permissions.canChangeArenaVOIP(),
'isObserverModeEnabled': self.__isObserverModeEnabled()})
return
示例7: getClanMotto
def getClanMotto(self):
return passCensor(self.motto)
示例8: getClanAbbrev
def getClanAbbrev(self):
return passCensor(self.tag)
示例9: getClanName
def getClanName(self):
return passCensor(self.name)
示例10: getTag
def getTag(self):
return passCensor(self.tag)
示例11: _formatString
def _formatString(value):
if not value or not len(value):
return clans_fmts.DUMMY_UNAVAILABLE_DATA
return passCensor(value)
示例12: getComment
def getComment(self, invite):
comment = passCensor(invite.comment)
if not comment:
return ''
return makeHtmlString('html_templates:lobby/prebattle', 'inviteComment', {'comment': i18n.makeString(I18N_INVITES.INVITES_COMMENT, comment=html.escape(comment))})
示例13: getClanName
def getClanName(self):
return passCensor(html.escape(self.itemData.clanName))
示例14: getClanDescr
def getClanDescr(self):
return passCensor(html.escape(self.itemData.clanDescr))
示例15: getClanAbbrev
def getClanAbbrev(self):
return passCensor(self._getClanInfoValue(1, ''))