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


Python external_strings_utils.truncate_utf8函数代码示例

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


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

示例1: packPascalString

def packPascalString(s):
    if isinstance(s, unicode):
        s = s.encode('utf8')
    s = truncate_utf8(s, MAX_PASCAL_STRING_LEN)
    buffer = struct.pack('<H', len(s))
    buffer += s
    return buffer
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:7,代码来源:ops_pack.py

示例2: __init__

 def __init__(self, databaseIDs, comment, waitingID=""):
     super(SendInvitesCtx, self).__init__(waitingID=waitingID)
     self.__databaseIDs = databaseIDs[:300]
     if comment:
         self.__comment = truncate_utf8(comment, INVITE_COMMENT_MAX_LENGTH)
     else:
         self.__comment = ""
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:7,代码来源:__init__.py

示例3: setComment

 def setComment(self, comment):
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
开发者ID:webiumsk,项目名称:WOT0.10.0,代码行数:2,代码来源:prb_ctx.py

示例4: __init__

 def __init__(self, prbType, waitingID = '', isOpened = True, comment = '', isRequestToCreate = True, flags = _FUNCTIONAL_FLAG.UNDEFINED):
     super(_TeamSettingsCtx, self).__init__(entityType=prbType, waitingID=waitingID, flags=flags)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self._isRequestToCreate = isRequestToCreate
开发者ID:webiumsk,项目名称:WOT0.10.0,代码行数:5,代码来源:prb_ctx.py

示例5: __init__

 def __init__(self, waitingID = '', isOpened = True, comment = '', isRequestToCreate = True, funcExit = prb_settings.FUNCTIONAL_EXIT.PREBATTLE):
     super(TeamSettingsCtx, self).__init__(waitingID=waitingID, funcExit=funcExit)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self.__isForced = False
     self._isRequestToCreate = isRequestToCreate
开发者ID:webiumsk,项目名称:WoT,代码行数:6,代码来源:prb_ctx.py

示例6: __init__

 def __init__(self, clubDbID, minWinRate = 0, minBattleCount = 0, description = '', waitingID = '', confirmID = ''):
     super(SetApplicantsRequirements, self).__init__(clubDbID, waitingID=waitingID, confirmID=confirmID)
     self.__minWinRate = minWinRate
     self.__minBattleCount = minBattleCount
     self.__description = truncate_utf8(description, CLUB_LIMITS.MAX_SHORT_DESC_LENGTH)
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:5,代码来源:contexts.py

示例7: __init__

 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentUnitCtx, self).__init__(waitingID=waitingID)
     self.__comment = truncate_utf8(comment, prb_settings.UNIT_COMMENT_MAX_LENGTH)
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:3,代码来源:unit_ctx.py


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