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 import parser
from httplib.exceptions import InvalidResponse, InvalidStatusLine, UnsupportedEncoding from httplib.exceptions import InvalidResponse, InvalidStatusLine, UnsupportedEncoding
from httplib.httpsocket import FORMAT from httplib.httpsocket import FORMAT
from httplib.message import ClientMessage as Message from httplib.message import ResponseMessage as Message
from httplib.retriever import PreambleRetriever from httplib.retriever import PreambleRetriever
sockets: Dict[str, HTTPClient] = {} sockets: Dict[str, HTTPClient] = {}

View File

@@ -9,7 +9,7 @@ from client.httpclient import HTTPClient
from httplib import parser from httplib import parser
from httplib.exceptions import InvalidResponse from httplib.exceptions import InvalidResponse
from httplib.httpsocket import FORMAT from httplib.httpsocket import FORMAT
from httplib.message import ClientMessage as Message from httplib.message import ResponseMessage as Message
from httplib.retriever import Retriever from httplib.retriever import Retriever
BASE_REGEX = re.compile(r"<\s*base[^>]*\shref\s*=\s*['\"]([^\"']+)['\"][^>]*>", re.M | re.I) 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 self.body = body
class ClientMessage(Message): class ResponseMessage(Message):
status: int status: int
msg: str msg: str
@@ -26,7 +26,7 @@ class ClientMessage(Message):
self.msg = msg self.msg = msg
class ServerMessage(Message): class RequestMessage(Message):
method: str method: str
target: SplitResult target: SplitResult

View File

@@ -9,7 +9,7 @@ from wsgiref.handlers import format_date_time
from httplib import parser from httplib import parser
from httplib.exceptions import NotFound, Forbidden, NotModified from httplib.exceptions import NotFound, Forbidden, NotModified
from httplib.httpsocket import FORMAT 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") 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, \ from httplib.exceptions import MethodNotAllowed, BadRequest, UnsupportedEncoding, NotImplemented, NotFound, \
HTTPVersionNotSupported HTTPVersionNotSupported
from httplib.httpsocket import HTTPSocket, FORMAT 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 httplib.retriever import Retriever, PreambleRetriever
from server import command from server import command
from server.serversocket import ServerSocket from server.serversocket import ServerSocket