From b110ab84fb5ea56774820b30df3ffb3c90d2ccf7 Mon Sep 17 00:00:00 2001 From: hackrush Date: Tue, 26 Mar 2019 23:05:43 +0530 Subject: [PATCH] Removed more stuff --- lbrynet/extras/daemon/Daemon.py | 9 ------ scripts/test_script_for_pipes.py | 47 -------------------------------- 2 files changed, 56 deletions(-) delete mode 100644 scripts/test_script_for_pipes.py diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index 3f2a2a898..864711bd9 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -448,15 +448,6 @@ class Daemon(metaclass=JSONRPCServerType): if self.analytics_manager.is_started: self.analytics_manager.stop() - async def handle_pipe_request(self, data): - data = json.loads(data) - ledger = None - if 'wallet' in self.component_manager.get_components_status(): - # self.ledger only available if wallet component is not skipped - ledger = self.ledger - result = await self._process_rpc_call(data) - return jsonrpc_dumps_pretty(result, ledger=ledger) - async def handle_old_jsonrpc(self, request): data = await request.json() result = await self._process_rpc_call(data) diff --git a/scripts/test_script_for_pipes.py b/scripts/test_script_for_pipes.py deleted file mode 100644 index 9dc4eb9a2..000000000 --- a/scripts/test_script_for_pipes.py +++ /dev/null @@ -1,47 +0,0 @@ -import asyncio -import json -import typing - -if typing.TYPE_CHECKING: - from typing import Optional - from asyncio import transports - - -path = r'\\.\pipe\lbrypipe' - -class WindowsPipeProtocol(asyncio.Protocol): - def __init__(self): - self.transport = None - self.closed = asyncio.Event() - - def connection_made(self, transport: 'transports.BaseTransport'): - self.transport = transport - message = {'method': 'account_balance', 'params': {}} - message = json.dumps(message) - self.transport.write(message.encode()) - - def connection_lost(self, exc: 'Optional[Exception]'): - self.closed.set() - - def data_received(self, data: bytes): - print(data.decode()) - self.transport.close() - self.closed.set() - - def eof_received(self): - pass - - -def windows_pipe_factory(): - return WindowsPipeProtocol - -async def main(): - loop = asyncio.get_event_loop() - transport, protocol = await loop.create_pipe_connection(windows_pipe_factory(), path) - await protocol.closed.wait() - - -if __name__ == "__main__": - asyncio.set_event_loop(asyncio.ProactorEventLoop()) - loop = asyncio.get_event_loop() - loop.run_until_complete(main())