示例#1
0
 def version(self, value):
     self._version = version = StompSpec.version(value)
     self._heartbeat = None if self._version == StompSpec.VERSION_1_0 else StompHeartBeat()
     self._commands = StompSpec.COMMANDS[version]
     self._commandsBodyAllowed = StompSpec.COMMANDS_BODY_ALLOWED[self.version]
     self._codec = StompSpec.codec(version)
     self._stripLineDelimiter = StompSpec.STRIP_LINE_DELIMITER.get(version, '')
     self._findHead = re.compile(2 * ('%s?%s' % (self._stripLineDelimiter, StompSpec.LINE_DELIMITER) if self._stripLineDelimiter else StompSpec.LINE_DELIMITER).encode()).search
示例#2
0
文件: frame.py 项目: tobgu/stompest
 def version(self, value):
     self._version = version = StompSpec.version(value)
     codec = StompSpec.codec(version)
     self._encode = lambda text: text.encode(codec)
示例#3
0
 def version(self, value):
     self._version = version = StompSpec.version(value)
     codec = StompSpec.codec(version)
     self._encode = lambda text: text.encode(codec)