Skip to content

Commit

Permalink
isort examples too
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh committed Jan 10, 2022
1 parent dde7543 commit a63cf22
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
3 changes: 2 additions & 1 deletion check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"""
import sys
import subprocess

from pathlib import Path

from proxy.common.version import __version__ as lib_version


# This script ensures our versions never run out of sync.
#
# 1. TODO: Version is hardcoded in homebrew stable package
Expand Down
8 changes: 2 additions & 6 deletions examples/https_connect_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
:license: BSD, see LICENSE for more details.
"""
import time

from typing import Any, Optional

from proxy import Proxy

from proxy.core.base import BaseTcpTunnelHandler
from proxy.http.responses import (
PROXY_TUNNEL_ESTABLISHED_RESPONSE_PKT,
PROXY_TUNNEL_UNSUPPORTED_SCHEME,
PROXY_TUNNEL_UNSUPPORTED_SCHEME, PROXY_TUNNEL_ESTABLISHED_RESPONSE_PKT,
)

from proxy.core.base import BaseTcpTunnelHandler


class HttpsConnectTunnelHandler(BaseTcpTunnelHandler):
"""A https CONNECT tunnel."""
Expand Down
10 changes: 6 additions & 4 deletions examples/pubsub_eventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
:license: BSD, see LICENSE for more details.
"""
import time
import multiprocessing
import logging
import multiprocessing
from typing import Any, Dict, Optional

from typing import Dict, Any, Optional

from proxy.core.event import (
EventQueue, EventManager, EventSubscriber, eventNames,
)
from proxy.common.constants import DEFAULT_LOG_FORMAT
from proxy.core.event import EventManager, EventQueue, EventSubscriber, eventNames


logging.basicConfig(level=logging.DEBUG, format=DEFAULT_LOG_FORMAT)

Expand Down
1 change: 1 addition & 0 deletions examples/ssl_echo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from proxy.core.connection import TcpServerConnection
from proxy.common.constants import DEFAULT_BUFFER_SIZE


logger = logging.getLogger(__name__)

if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions examples/ssl_echo_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
from typing import Optional

from proxy import Proxy
from proxy.core.base import BaseTcpServerHandler
from proxy.common.utils import wrap_socket
from proxy.core.connection import TcpClientConnection

from proxy.core.base import BaseTcpServerHandler


class EchoSSLServerHandler(BaseTcpServerHandler):
"""Wraps client socket during initialization."""
Expand Down
1 change: 1 addition & 0 deletions examples/tcp_echo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from proxy.common.utils import socket_connection
from proxy.common.constants import DEFAULT_BUFFER_SIZE


logger = logging.getLogger(__name__)

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion examples/web_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import time

from proxy import Proxy
from proxy.common.types import Readables, Writables, SelectableEvents
from proxy.core.acceptor import Work
from proxy.core.connection import TcpClientConnection
from proxy.common.types import Readables, SelectableEvents, Writables


class WebScraper(Work[TcpClientConnection]):
Expand Down
5 changes: 4 additions & 1 deletion examples/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import time
import logging

from proxy.http.websocket import WebsocketClient, WebsocketFrame, websocketOpcodes
from proxy.http.websocket import (
WebsocketFrame, WebsocketClient, websocketOpcodes,
)


# globals
client: WebsocketClient
Expand Down

0 comments on commit a63cf22

Please sign in to comment.