refactoring

This commit is contained in:
Jefry Lagrange 2011-12-22 20:12:11 -05:00
parent eec056ccd1
commit 78e7361bf2
1 changed files with 17 additions and 18 deletions

View File

@ -60,6 +60,8 @@ class JingleTransport(object):
"""
pass
def make_transport(self, candidates=None):
"""
Build a transport stanza with the given candidates (or self.candidates if
@ -78,6 +80,20 @@ class JingleTransport(object):
"""
return []
def set_connection(self, conn):
self.connection = conn
if not self.sid:
self.sid = self.connection.connection.getAnID()
def set_file_props(self, file_props):
self.file_props = file_props
def set_our_jid(self, jid):
self.ourjid = jid
def set_sid(self, sid):
self.sid = sid
class JingleTransportSocks5(JingleTransport):
"""
Socks5 transport in jingle scenario
@ -91,16 +107,6 @@ class JingleTransportSocks5(JingleTransport):
if node and node.getAttr('sid'):
self.sid = node.getAttr('sid')
def set_file_props(self, file_props):
self.file_props = file_props
def set_our_jid(self, jid):
self.ourjid = jid
def set_connection(self, conn):
self.connection = conn
if not self.sid:
self.sid = self.connection.connection.getAnID()
def make_candidate(self, candidate):
import logging
@ -309,9 +315,6 @@ class JingleTransportIBB(JingleTransport):
self.sid = node.getAttr('sid')
def set_sid(self, sid):
self.sid = sid
def make_transport(self):
transport = xmpp.Node('transport')
@ -320,10 +323,6 @@ class JingleTransportIBB(JingleTransport):
transport.setAttr('sid', self.sid)
return transport
def set_file_props(self, file_props):
self.file_props = file_props
import farsight
class JingleTransportICEUDP(JingleTransport):