From c531e6d146db20f64b67c924e5bf0007dfcafb3c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 18 May 2018 13:47:47 +0200 Subject: [PATCH] Rename protocol impl files --- pyrogram/connection/connection.py | 8 ++++---- pyrogram/connection/transport/tcp/__init__.py | 6 +++--- .../transport/tcp/{tcp_abridged.py => abridged.py} | 2 +- .../connection/transport/tcp/{tcp_full.py => full.py} | 2 +- .../tcp/{tcp_intermediate.py => intermediate.py} | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) rename pyrogram/connection/transport/tcp/{tcp_abridged.py => abridged.py} (98%) rename pyrogram/connection/transport/tcp/{tcp_full.py => full.py} (99%) rename pyrogram/connection/transport/tcp/{tcp_intermediate.py => intermediate.py} (96%) diff --git a/pyrogram/connection/connection.py b/pyrogram/connection/connection.py index 118f0d83..4b9cf6a8 100644 --- a/pyrogram/connection/connection.py +++ b/pyrogram/connection/connection.py @@ -27,15 +27,15 @@ log = logging.getLogger(__name__) class Connection: MODES = { - 0: TCPFull, - 1: TCPAbridged, - 2: TCPIntermediate + 0: Full, + 1: Abridged, + 2: Intermediate } def __init__(self, address: tuple, proxy: dict, mode: int = 1): self.address = address self.proxy = proxy - self.mode = self.MODES.get(mode, TCPAbridged) + self.mode = self.MODES.get(mode, Abridged) self.lock = threading.Lock() self.connection = None diff --git a/pyrogram/connection/transport/tcp/__init__.py b/pyrogram/connection/transport/tcp/__init__.py index d1daff63..0298e04b 100644 --- a/pyrogram/connection/transport/tcp/__init__.py +++ b/pyrogram/connection/transport/tcp/__init__.py @@ -16,6 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from .tcp_abridged import TCPAbridged -from .tcp_full import TCPFull -from .tcp_intermediate import TCPIntermediate +from .abridged import Abridged +from .full import Full +from .intermediate import Intermediate diff --git a/pyrogram/connection/transport/tcp/tcp_abridged.py b/pyrogram/connection/transport/tcp/abridged.py similarity index 98% rename from pyrogram/connection/transport/tcp/tcp_abridged.py rename to pyrogram/connection/transport/tcp/abridged.py index 472f4799..076badad 100644 --- a/pyrogram/connection/transport/tcp/tcp_abridged.py +++ b/pyrogram/connection/transport/tcp/abridged.py @@ -23,7 +23,7 @@ from .tcp import TCP log = logging.getLogger(__name__) -class TCPAbridged(TCP): +class Abridged(TCP): def __init__(self, proxy: dict): super().__init__(proxy) diff --git a/pyrogram/connection/transport/tcp/tcp_full.py b/pyrogram/connection/transport/tcp/full.py similarity index 99% rename from pyrogram/connection/transport/tcp/tcp_full.py rename to pyrogram/connection/transport/tcp/full.py index 1b131678..5707cdfb 100644 --- a/pyrogram/connection/transport/tcp/tcp_full.py +++ b/pyrogram/connection/transport/tcp/full.py @@ -25,7 +25,7 @@ from .tcp import TCP log = logging.getLogger(__name__) -class TCPFull(TCP): +class Full(TCP): def __init__(self, proxy: dict): super().__init__(proxy) self.seq_no = None diff --git a/pyrogram/connection/transport/tcp/tcp_intermediate.py b/pyrogram/connection/transport/tcp/intermediate.py similarity index 96% rename from pyrogram/connection/transport/tcp/tcp_intermediate.py rename to pyrogram/connection/transport/tcp/intermediate.py index d99ca463..46546d1d 100644 --- a/pyrogram/connection/transport/tcp/tcp_intermediate.py +++ b/pyrogram/connection/transport/tcp/intermediate.py @@ -19,12 +19,12 @@ import logging from struct import pack, unpack -from .tcp_abridged import TCP +from .abridged import TCP log = logging.getLogger(__name__) -class TCPIntermediate(TCP): +class Intermediate(TCP): def __init__(self, proxy: dict): super().__init__(proxy)