Rename Server- and ClientMessage

Renamed ServerMessage and ClientMessage to respectively ResponseMessage
and RequestMessage to make it more clear.
This commit is contained in:
2021-03-28 01:59:08 +01:00
parent 1f0ade0f09
commit 48c4f207a8
5 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ from client.httpclient import HTTPClient
from httplib import parser
from httplib.exceptions import InvalidResponse, InvalidStatusLine, UnsupportedEncoding
from httplib.httpsocket import FORMAT
from httplib.message import ClientMessage as Message
from httplib.message import ResponseMessage as Message
from httplib.retriever import PreambleRetriever
sockets: Dict[str, HTTPClient] = {}

View File

@@ -9,7 +9,7 @@ from client.httpclient import HTTPClient
from httplib import parser
from httplib.exceptions import InvalidResponse
from httplib.httpsocket import FORMAT
from httplib.message import ClientMessage as Message
from httplib.message import ResponseMessage as Message
from httplib.retriever import Retriever
BASE_REGEX = re.compile(r"<\s*base[^>]*\shref\s*=\s*['\"]([^\"']+)['\"][^>]*>", re.M | re.I)

View File

@@ -16,7 +16,7 @@ class Message(ABC):
self.body = body
class ClientMessage(Message):
class ResponseMessage(Message):
status: int
msg: str
@@ -26,7 +26,7 @@ class ClientMessage(Message):
self.msg = msg
class ServerMessage(Message):
class RequestMessage(Message):
method: str
target: SplitResult

View File

@@ -9,7 +9,7 @@ from wsgiref.handlers import format_date_time
from httplib import parser
from httplib.exceptions import NotFound, Forbidden, NotModified
from httplib.httpsocket import FORMAT
from httplib.message import ServerMessage as Message
from httplib.message import RequestMessage as Message
CONTENT_ROOT = os.path.join(os.path.dirname(sys.argv[0]), "public")

View File

@@ -12,7 +12,7 @@ from httplib import parser
from httplib.exceptions import MethodNotAllowed, BadRequest, UnsupportedEncoding, NotImplemented, NotFound, \
HTTPVersionNotSupported
from httplib.httpsocket import HTTPSocket, FORMAT
from httplib.message import ServerMessage as Message
from httplib.message import RequestMessage as Message
from httplib.retriever import Retriever, PreambleRetriever
from server import command
from server.serversocket import ServerSocket