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


Python LineReceiver.sendLine方法代码示例

本文整理汇总了Python中twisted.protocols.basic.LineReceiver.sendLine方法的典型用法代码示例。如果您正苦于以下问题:Python LineReceiver.sendLine方法的具体用法?Python LineReceiver.sendLine怎么用?Python LineReceiver.sendLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.protocols.basic.LineReceiver的用法示例。


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

示例1: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     if self.onXMLReceived:
         raise FoneworxException, "onXMLReceived already initialized before sending"
     self.onXMLReceived = Deferred()
     log.msg("Sending line: %s" % line, logLevel=logging.DEBUG)
     LineReceiver.sendLine(self, line)
     return self.onXMLReceived
开发者ID:sanyaade,项目名称:python-foneworx,代码行数:9,代码来源:protocol.py

示例2: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     """
     Override sendLine to add a timeout to response.
     """
     if not self._current:
         self.setTimeout(self.persistentTimeOut)
     LineReceiver.sendLine(self, line)
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:9,代码来源:memcache.py

示例3: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     if isinstance(line, str):
         if six.PY3:
             super(StringLineReceiver, self).sendLine(line.encode())
         else:
             LineReceiver.sendLine(self, line.encode())
     elif isinstance(line, bytes):
         if six.PY3:
             super(StringLineReceiver, self).sendLine(line)
         else:
             LineReceiver.sendLine(self, line)
     else:
         raise RuntimeError("Only str and bytes are allowed.")
开发者ID:2php,项目名称:veles,代码行数:15,代码来源:network_common.py

示例4: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
    def sendLine(self, line):
        self.log.info('SEND: ' + line)

        for regex, callback in self.send_line_hooks:
            if regex.match(line) is not None:
                callback(self, line)

        return LineReceiver.sendLine(self, line)
开发者ID:pombredanne,项目名称:twisted-lock,代码行数:10,代码来源:lock.py

示例5: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, s):
     #print('->', s)
     LineReceiver.sendLine(self, s)
开发者ID:kgofron,项目名称:oneWire,代码行数:5,代码来源:ha7e-addresses.py

示例6: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     if self._ping_deferred:
         self._ping_deferred.reset(self.ping_interval)
     return LineReceiver.sendLine(self, line)
开发者ID:B-Rich,项目名称:ibid-1,代码行数:6,代码来源:dcwords.py

示例7: sendCommand

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendCommand(self, cmd):
     print ">", cmd
     LineReceiver.sendLine( self, cjson.encode(cmd) )
开发者ID:yovae,项目名称:owgs,代码行数:5,代码来源:gtpbot.py

示例8: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     if isinstance(line, unicode):
         line = line.encode('utf-8')
     LineReceiver.sendLine(self, line)
开发者ID:yiminlong,项目名称:chatd,代码行数:6,代码来源:protocol.py

示例9: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
		def sendLine(self, line):
			log_outgoing(line)
			LineReceiver.sendLine(self, line)
开发者ID:ashafer01,项目名称:ExtraIRC,代码行数:5,代码来源:downlink.py

示例10: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     # Assure that the string isn't unicode.
     return LineReceiver.sendLine(self, str(line))
开发者ID:EntityReborn,项目名称:SupportChat,代码行数:5,代码来源:chatclient.py

示例11: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     print "Relay -> iPhone",line
     LineReceiver.sendLine(self,line)
开发者ID:089,项目名称:invisiblePGP,代码行数:5,代码来源:invisiblePGP.py

示例12: _reallySendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
	def _reallySendLine(self, line):
		if self.debug >= 2: print "REALLY SENDING LINE:", repr(lowQuote(line) + self.delimiter)
		return LineReceiver.sendLine(self, lowQuote(line) + self.delimiter)
开发者ID:ckx,项目名称:pyBurlyBot,代码行数:5,代码来源:client.py

示例13: send

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def send(self, data):
     LineReceiver.sendLine(self, data)  # LineReceiver is an old style class.
开发者ID:KaptenJon,项目名称:calvin-base,代码行数:4,代码来源:server_connection.py

示例14: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, line):
     LineReceiver.sendLine(self, line)
开发者ID:BackupTheBerlios,项目名称:solipsis-svn,代码行数:4,代码来源:unittest_network.py

示例15: sendLine

# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import sendLine [as 别名]
 def sendLine(self, data):
     "Send data to remote server"
     # <data> has to be JSON-encoded before being sent to remote server
     twisted_logger.writeLog(self.logPrefix, self.logName, "Sending data to remote server: %s..." % data)
     LineReceiver.sendLine(self, json.dumps(data))
开发者ID:vpogrebi,项目名称:SCS_CONTROLLER,代码行数:7,代码来源:client.py


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