Skip to content

Commit

Permalink
Move files into a module
Browse files Browse the repository at this point in the history
  • Loading branch information
De117 committed Nov 11, 2022
1 parent e2191ea commit 478250d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from hypothesis import given, settings, HealthCheck
from hypothesis.strategies import data, integers, binary, floats

from proxy import splice
from whitelisting_proxy.proxy import splice


@given(integers(1, 100), data())
Expand Down Expand Up @@ -34,7 +34,7 @@ async def testit(a, b):
nursery.start_soon(testit, client, server)


from proxy import WhitelistingProxy, run_synchronously_cancellable_proxy
from whitelisting_proxy.proxy import WhitelistingProxy, run_synchronously_cancellable_proxy

# Thread scheduling varies, so we cannot reliably (nor quickly) test
# if SynchronousWhitelistingProxy cancellation works, i.e. that:
Expand Down
9 changes: 9 additions & 0 deletions whitelisting_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .proxy import (
WhitelistingProxy,
SynchronousWhitelistingProxy,
Port,
Domain,
Configuration,
parse_configuration_v1,
load_configuration_from_file,
)
2 changes: 1 addition & 1 deletion main.py → whitelisting_proxy/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import trio, threading, signal, argparse, sys
from functools import partial
from typing import Union, Tuple, Set
from proxy import WhitelistingProxy, SynchronousWhitelistingProxy, load_configuration_from_file
from .proxy import WhitelistingProxy, SynchronousWhitelistingProxy, load_configuration_from_file

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion proxy.py → whitelisting_proxy/proxy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import trio, h11, threading, re, json
from adapter import TrioHTTPConnection
from .adapter import TrioHTTPConnection
from functools import partial
from dataclasses import dataclass
from typing import Callable, Union, Iterable, Tuple, Set
Expand Down

0 comments on commit 478250d

Please sign in to comment.