本文整理汇总了Python中pandac.PandaModules.TextEncoder.strip方法的典型用法代码示例。如果您正苦于以下问题:Python TextEncoder.strip方法的具体用法?Python TextEncoder.strip怎么用?Python TextEncoder.strip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.TextEncoder
的用法示例。
在下文中一共展示了TextEncoder.strip方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __typedAName
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def __typedAName(self, *args):
self.notify.debug('__typedAName')
self.nameEntry['focus'] = 0
name = self.nameEntry.get()
name = TextEncoder().decodeText(name)
name = name.strip()
name = TextEncoder().encodeWtext(name)
self.nameEntry.enterText(name)
problem = self.nameIsValid(self.nameEntry.get())
if problem:
self.rejectName(problem)
return
self.checkNameTyped(justCheck=True)
示例2: _typedAName
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def _typedAName(self, *args):
self.nameEntry['focus'] = 0
name = self.nameEntry.get()
name = TextEncoder().decodeText(name)
name = name.strip()
name = TextEncoder().encodeWtext(name)
self.nameEntry.enterText(name)
self.notify.debug('Chosen name: %s' % self.nameEntry.get())
problem = NameCheck.checkName(name, [
self._checkNpcNames], font = self.nameEntry.getFont())
if problem:
print problem
self.nameEntry.enterText('')
else:
self.fsm.request('Approved')
示例3: complete
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def complete(self):
self.nameEntry['focus'] = 0
name = self.nameEntry.get()
name = TextEncoder().decodeText(name)
name = name.strip()
name = TextEncoder().encodeWtext(name)
self.nameEntry.enterText(name)
self.notify.debug('Chosen name: %s' % name)
if self.customName:
problem = NameCheck.checkName(name, [
self._checkNpcNames], font = self.nameEntry.getFont())
if problem:
print problem
self.nameEntry.enterText('')
else:
self.fsm.request('Done')
else:
self.fsm.request('Done')
示例4: getTypeANameProblem
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def getTypeANameProblem(self, callback):
if not self.customName:
callback(None)
else:
problem = None
name = self.nameEntry.get()
name = TextEncoder().decodeText(name)
name = name.strip()
name = TextEncoder().encodeWtext(name)
self.nameEntry.enterText(name)
problem = NameCheck.checkName(self.nameEntry.get(), [
self._checkNpcNames], font = self.nameEntry.getFont())
if problem:
callback(problem)
elif self.cr:
self.ignore(self.cr.getWishNameResultMsg())
self.acceptOnce(self.cr.getWishNameResultMsg(), self._handleSetWishnameResult)
self._nameCheckCallback = callback
self._sendSetWishname(justCheck = True)
return None
示例5: _getName
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def _getName(self):
newName = ''
if self.mode == self._NameGUI__MODE_TYPEANAME:
newName = self.nameEntry.get()
newName = TextEncoder().decodeText(newName)
newName = newName.strip()
newName = TextEncoder().encodeWtext(newName)
else:
newName += self.names[0]
if len(newName) > 0 and len(self.names[1]) > 0:
newName += ' '
newName += self.names[1]
if len(newName) > 0 and len(self.names[2]) > 0:
newName += ' '
newName += self.names[2]
if self.names[2] in PL.PirateNames_LastNamePrefixesCapped:
newName += self.names[3].capitalize()
else:
newName += self.names[3]
return newName
示例6: match
# 需要导入模块: from pandac.PandaModules import TextEncoder [as 别名]
# 或者: from pandac.PandaModules.TextEncoder import strip [as 别名]
def match(npcName, name = name):
name = TextEncoder().encodeWtext(name)
name = name.strip()
return TextEncoder.upper(npcName) == TextEncoder.upper(name)