Fix method signatures

This commit is contained in:
Dan 2017-12-06 19:24:46 +01:00
parent 29ef38df89
commit 055367fe9c
8 changed files with 8 additions and 8 deletions

View File

@ -32,7 +32,7 @@ class FutureSalt(Object):
self.salt = salt
@staticmethod
def read(b: BytesIO) -> "FutureSalt":
def read(b: BytesIO, *args) -> "FutureSalt":
valid_since = datetime.fromtimestamp(Int.read(b))
valid_until = datetime.fromtimestamp(Int.read(b))
salt = Long.read(b)

View File

@ -33,7 +33,7 @@ class FutureSalts(Object):
self.salts = salts
@staticmethod
def read(b: BytesIO) -> "FutureSalts":
def read(b: BytesIO, *args) -> "FutureSalts":
req_msg_id = Long.read(b)
now = datetime.fromtimestamp(Int.read(b))

View File

@ -30,7 +30,7 @@ class GzipPacked(Object):
self.packed_data = packed_data
@staticmethod
def read(b: BytesIO) -> "GzipPacked":
def read(b: BytesIO, *args) -> "GzipPacked":
# Return the Object itself instead of a GzipPacked wrapping it
return Object.read(
BytesIO(

View File

@ -32,7 +32,7 @@ class Message(Object):
self.body = body
@staticmethod
def read(b: BytesIO) -> "Message":
def read(b: BytesIO, *args) -> "Message":
msg_id = Long.read(b)
seq_no = Int.read(b)
length = Int.read(b)

View File

@ -30,7 +30,7 @@ class MsgContainer(Object):
self.messages = messages
@staticmethod
def read(b: BytesIO) -> "MsgContainer":
def read(b: BytesIO, *args) -> "MsgContainer":
count = Int.read(b)
return MsgContainer([Message.read(b) for _ in range(count)])

View File

@ -23,7 +23,7 @@ from ..object import Object
class Bytes(Object):
@staticmethod
def read(b: BytesIO) -> bytes:
def read(b: BytesIO, *args) -> bytes:
length = int.from_bytes(b.read(1), "little")
if length <= 253:

View File

@ -24,7 +24,7 @@ from ..object import Object
class Double(Object):
@staticmethod
def read(b: BytesIO) -> float:
def read(b: BytesIO, *args) -> float:
return unpack("d", b.read(8))[0]
def __new__(cls, value: float) -> bytes:

View File

@ -23,7 +23,7 @@ from . import Bytes
class String(Bytes):
@staticmethod
def read(b: BytesIO) -> str:
def read(b: BytesIO, *args) -> str:
return super(String, String).read(b).decode()
def __new__(cls, value: str) -> bytes: