Commit 09b64b9f authored by André's avatar André

Remove suffix from transports_nb

parent e63e4723
Pipeline #3031 passed with stages
in 18 seconds
......@@ -9,7 +9,7 @@ Thanks and credits to the xmpppy developers. See: http://xmpppy.sourceforge.net/
"""
from .protocol import *
from . import simplexml, protocol, auth, transports_nb, roster
from . import simplexml, protocol, auth, transports, roster
from . import dispatcher, features, idlequeue, bosh, tls, proxy_connectors
from .client import NonBlockingClient
from .plugin import PlugIn
......
......@@ -23,7 +23,7 @@ import locale
import logging
from hashlib import sha1
from .transports_nb import NonBlockingTransport, NonBlockingHTTPBOSH,\
from .transports import NonBlockingTransport, NonBlockingHTTPBOSH,\
CONNECTED, CONNECTING, DISCONNECTED, DISCONNECTING,\
urisplit, DISCONNECT_TIMEOUT_SECONDS
from .protocol import BOSHBody, Protocol, NS_CLIENT
......
......@@ -20,7 +20,7 @@ Client class establishes connection to XMPP Server and handles authentication
import socket
import logging
from . import transports_nb, dispatcher, roster, protocol, bosh
from . import transports, dispatcher, roster, protocol, bosh
from .protocol import NS_TLS
from .protocol import JID
from .auth import SASL
......@@ -243,7 +243,7 @@ class NonBlockingClient:
# tcp_host is hostname of machine used for socket connection
# (DNS request will be done for proxy or BOSH CM hostname)
tcp_host, tcp_port, proxy_user, proxy_pass = \
transports_nb.get_proxy_data_from_dict(proxy)
transports.get_proxy_data_from_dict(proxy)
if proxy['type'] == 'bosh':
# Setup BOSH transport
......@@ -270,7 +270,7 @@ class NonBlockingClient:
if not proxy or proxy['type'] != 'bosh':
# Setup ordinary TCP transport
self.socket = transports_nb.NonBlockingTCP.get_instance(
self.socket = transports.NonBlockingTCP.get_instance(
on_disconnect=self.disconnect,
raise_event=self.raise_event,
idlequeue=self.idlequeue,
......
## proxy_connectors.py
## based on transports_nb.py
##
## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov
## modified by Dimitur Kirov <dkirov@gmail.com>
......
......@@ -21,7 +21,7 @@ import logging
from nbxmpp.protocol import NS_STREAM_MGMT
from nbxmpp.protocol import NS_DELAY2
from nbxmpp.simplexml import Node
from nbxmpp.transports_nb import DISCONNECTING
from nbxmpp.transports import DISCONNECTING
from nbxmpp.plugin import PlugIn
from nbxmpp.const import Realm
from nbxmpp.const import Event
......
## transports_nb.py
## based on transports.py
## transports.py
##
## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov
## modified by Dimitur Kirov <dkirov@gmail.com>
......@@ -39,7 +38,7 @@ from .idlequeue import IdleObject
from . import proxy_connectors
from . import tls
log = logging.getLogger('nbxmpp.transports_nb')
log = logging.getLogger('nbxmpp.transports')
def urisplit(uri):
"""
......
......@@ -4,7 +4,7 @@ Unit test for tranports classes.
import unittest
from nbxmpp import transports_nb
from nbxmpp import transports
class TestModuleLevelFunctions(unittest.TestCase):
......@@ -13,7 +13,7 @@ class TestModuleLevelFunctions(unittest.TestCase):
'''
def test_urisplit(self):
def check_uri(uri, proto, host, port, path):
_proto, _host, _port, _path = transports_nb.urisplit(uri)
_proto, _host, _port, _path = transports.urisplit(uri)
self.assertEqual(proto, _proto)
self.assertEqual(host, _host)
self.assertEqual(path, _path)
......@@ -30,7 +30,7 @@ class TestModuleLevelFunctions(unittest.TestCase):
def test_get_proxy_data_from_dict(self):
def check_dict(proxy_dict, host, port, user, passwd):
_host, _port, _user, _passwd = transports_nb.get_proxy_data_from_dict(
_host, _port, _user, _passwd = transports.get_proxy_data_from_dict(
proxy_dict)
self.assertEqual(_host, host)
self.assertEqual(_port, port)
......
......@@ -7,7 +7,7 @@ import unittest
import socket
from test.lib.xmpp_mocks import IdleQueueThread, IdleMock
from nbxmpp import transports_nb
from nbxmpp import transports
class AbstractTransportTest(unittest.TestCase):
......@@ -72,7 +72,7 @@ class TestNonBlockingTCP(AbstractTransportTest):
except socket.error as e:
self.testcase.fail(msg=str(e))
self.socket = transports_nb.NonBlockingTCP(
self.socket = transports.NonBlockingTCP(
raise_event=lambda event_type, data: self.testcase.assertTrue(
event_type and data),
on_disconnect=lambda: self.on_success(mode='SocketDisconnect'),
......@@ -210,7 +210,7 @@ class TestNonBlockingHTTP(AbstractTransportTest):
}
def _get_transport(self, http_dict, proxy_dict=None):
return transports_nb.NonBlockingHTTP(
return transports.NonBlockingHTTP(
raise_event=None,
on_disconnect=None,
idlequeue=self.idlequeue_thread.iq,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment