mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-04-04 13:01:26 +00:00
lint
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import asyncio
|
||||
from .net_stream_interface import INetStream
|
||||
|
||||
|
||||
class NetStream(INetStream):
|
||||
|
||||
def __init__(self, muxed_stream):
|
||||
self.muxed_stream = muxed_stream
|
||||
self.protocol_id = None
|
||||
|
||||
def get_protocol(self):
|
||||
"""
|
||||
@ -26,12 +27,12 @@ class NetStream(INetStream):
|
||||
"""
|
||||
return await self.muxed_stream.read()
|
||||
|
||||
async def write(self, bytes):
|
||||
async def write(self, data):
|
||||
"""
|
||||
write to stream
|
||||
:return: number of bytes written
|
||||
"""
|
||||
return await self.muxed_stream.write(bytes)
|
||||
return await self.muxed_stream.write(data)
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
class INetStream(ABC):
|
||||
|
||||
def __init__(self, peer_id, multi_addr, connection):
|
||||
self.peer_id = peer_id
|
||||
self.multi_addr = multi_addr
|
||||
self.connection = connection
|
||||
class INetStream(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def get_protocol(self):
|
||||
|
||||
Reference in New Issue
Block a user