aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2021-03-06 23:18:58 -0800
committerZac Medico <zmedico@gentoo.org>2021-03-06 23:32:04 -0800
commitb4f6a5126437afc5bb07ed0a42a0eb8a5745ef90 (patch)
treeb360fdfaa168d1390cbe161fa39f3d69795e6d02
parentRemove unused _EventLoopFuture class (diff)
downloadportage-b4f6a5126437afc5bb07ed0a42a0eb8a5745ef90.tar.gz
portage-b4f6a5126437afc5bb07ed0a42a0eb8a5745ef90.tar.bz2
portage-b4f6a5126437afc5bb07ed0a42a0eb8a5745ef90.zip
Removed unused portage.util.futures.events
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/util/futures/events.py186
-rw-r--r--lib/portage/util/futures/unix_events.py26
2 files changed, 3 insertions, 209 deletions
diff --git a/lib/portage/util/futures/events.py b/lib/portage/util/futures/events.py
deleted file mode 100644
index 85032fcdf..000000000
--- a/lib/portage/util/futures/events.py
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright 2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-__all__ = (
- 'AbstractEventLoopPolicy',
- 'AbstractEventLoop',
-)
-
-import socket
-import subprocess
-
-from asyncio.events import (
- AbstractEventLoop as _AbstractEventLoop,
- AbstractEventLoopPolicy as _AbstractEventLoopPolicy,
-)
-
-
-class AbstractEventLoopPolicy(_AbstractEventLoopPolicy):
- """Abstract policy for accessing the event loop."""
-
- def get_event_loop(self):
- raise NotImplementedError
-
- def set_event_loop(self, loop):
- raise NotImplementedError
-
- def new_event_loop(self):
- raise NotImplementedError
-
- def get_child_watcher(self):
- raise NotImplementedError
-
- def set_child_watcher(self, watcher):
- raise NotImplementedError
-
-
-class AbstractEventLoop(_AbstractEventLoop):
- """Abstract event loop."""
-
- def run_forever(self):
- raise NotImplementedError
-
- def run_until_complete(self, future):
- raise NotImplementedError
-
- def stop(self):
- raise NotImplementedError
-
- def is_running(self):
- raise NotImplementedError
-
- def is_closed(self):
- raise NotImplementedError
-
- def close(self):
- raise NotImplementedError
-
- def shutdown_asyncgens(self):
- raise NotImplementedError
-
- def _timer_handle_cancelled(self, handle):
- raise NotImplementedError
-
- def call_soon(self, callback, *args):
- return self.call_later(0, callback, *args)
-
- def call_later(self, delay, callback, *args):
- raise NotImplementedError
-
- def call_at(self, when, callback, *args):
- raise NotImplementedError
-
- def time(self):
- raise NotImplementedError
-
- def create_future(self):
- raise NotImplementedError
-
- def create_task(self, coro):
- raise NotImplementedError
-
- def call_soon_threadsafe(self, callback, *args):
- raise NotImplementedError
-
- def run_in_executor(self, executor, func, *args):
- raise NotImplementedError
-
- def set_default_executor(self, executor):
- raise NotImplementedError
-
- def getaddrinfo(self, host, port, family=0, type=0, proto=0, flags=0): # pylint: disable=redefined-builtin
- raise NotImplementedError
-
- def getnameinfo(self, sockaddr, flags=0):
- raise NotImplementedError
-
- def create_connection(self, protocol_factory, host=None, port=None,
- ssl=None, family=0, proto=0, flags=0, sock=None,
- local_addr=None, server_hostname=None):
- raise NotImplementedError
-
- def create_server(self, protocol_factory, host=None, port=None,
- family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE,
- sock=None, backlog=100, ssl=None, reuse_address=None,
- reuse_port=None):
- raise NotImplementedError
-
- def create_unix_connection(self, protocol_factory, path,
- ssl=None, sock=None,
- server_hostname=None):
- raise NotImplementedError
-
- def create_unix_server(self, protocol_factory, path,
- sock=None, backlog=100, ssl=None):
- raise NotImplementedError
-
- def create_datagram_endpoint(self, protocol_factory,
- local_addr=None, remote_addr=None,
- family=0, proto=0, flags=0,
- reuse_address=None, reuse_port=None,
- allow_broadcast=None, sock=None):
- raise NotImplementedError
-
- def connect_read_pipe(self, protocol_factory, pipe):
- raise NotImplementedError
-
- def connect_write_pipe(self, protocol_factory, pipe):
- raise NotImplementedError
-
- def subprocess_shell(self, protocol_factory, cmd, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- **kwargs):
- raise NotImplementedError
-
- def subprocess_exec(self, protocol_factory, *args, **kwargs):
- for k in ('stdin', 'stdout', 'stderr'):
- kwargs.setdefault(k, subprocess.PIPE)
- raise NotImplementedError
-
- def add_writer(self, fd, callback, *args):
- raise NotImplementedError
-
- def remove_writer(self, fd):
- raise NotImplementedError
-
- def sock_recv(self, sock, nbytes):
- raise NotImplementedError
-
- def sock_sendall(self, sock, data):
- raise NotImplementedError
-
- def sock_connect(self, sock, address):
- raise NotImplementedError
-
- def sock_accept(self, sock):
- raise NotImplementedError
-
- def add_signal_handler(self, sig, callback, *args):
- raise NotImplementedError
-
- def remove_signal_handler(self, sig):
- raise NotImplementedError
-
- def set_task_factory(self, factory):
- raise NotImplementedError
-
- def get_task_factory(self):
- raise NotImplementedError
-
- def get_exception_handler(self):
- raise NotImplementedError
-
- def set_exception_handler(self, handler):
- raise NotImplementedError
-
- def default_exception_handler(self, context):
- raise NotImplementedError
-
- def call_exception_handler(self, context):
- raise NotImplementedError
-
- def get_debug(self):
- raise NotImplementedError
-
- def set_debug(self, enabled):
- raise NotImplementedError
diff --git a/lib/portage/util/futures/unix_events.py b/lib/portage/util/futures/unix_events.py
index 9d5445943..030070b1b 100644
--- a/lib/portage/util/futures/unix_events.py
+++ b/lib/portage/util/futures/unix_events.py
@@ -7,7 +7,8 @@ __all__ = (
)
import asyncio as _real_asyncio
-from asyncio.unix_events import AbstractChildWatcher as _AbstractChildWatcher
+from asyncio import events
+from asyncio.unix_events import AbstractChildWatcher
import fcntl
import os
@@ -15,7 +16,6 @@ import os
from portage.util._eventloop.global_event_loop import (
global_event_loop as _global_event_loop,
)
-from portage.util.futures import events
class _PortageEventLoop(events.AbstractEventLoop):
@@ -83,27 +83,7 @@ else:
fcntl.fcntl(fd, fcntl.F_SETFL, flags)
-class AbstractChildWatcher(_AbstractChildWatcher):
- def add_child_handler(self, pid, callback, *args):
- raise NotImplementedError()
-
- def remove_child_handler(self, pid):
- raise NotImplementedError()
-
- def attach_loop(self, loop):
- raise NotImplementedError()
-
- def close(self):
- raise NotImplementedError()
-
- def __enter__(self):
- raise NotImplementedError()
-
- def __exit__(self, a, b, c):
- raise NotImplementedError()
-
-
-class _PortageChildWatcher(_AbstractChildWatcher):
+class _PortageChildWatcher(AbstractChildWatcher):
def __init__(self, loop):
"""
@type loop: EventLoop