Commit 0301f87d authored by Tom Niget's avatar Tom Niget

Remove object base class

parent bb2a6abf
......@@ -30,7 +30,7 @@ from nemu.interface import *
from nemu.node import *
class _Config(object):
class _Config:
"""Global configuration singleton for Nemu."""
def __init__(self):
......
......@@ -28,7 +28,7 @@ __all__ = ['NodeInterface', 'P2PInterface', 'ImportedInterface',
'ImportedNodeInterface', 'Switch']
class Interface(object):
class Interface:
"""Just a base class for the *Interface classes: assign names and handle
destruction."""
_nextid = 0
......
......@@ -207,7 +207,7 @@ class bridge(interface):
return r
class address(object):
class address:
"""Class for internal use. It is mostly a data container used to easily
pass information around; with some convenience methods. __eq__ and
__hash__ are defined just to be able to easily find duplicated
......@@ -252,7 +252,7 @@ class ipv6address(address):
return s % (self.__module__, self.__class__.__name__,
self.address.__repr__(), self.prefix_len)
class route(object):
class route:
tipes = ["unicast", "local", "broadcast", "multicast", "throw",
"unreachable", "prohibit", "blackhole", "nat"]
......
......@@ -35,7 +35,7 @@ from nemu.environ import *
__all__ = ['Node', 'get_nodes', 'import_if']
class Node(object):
class Node:
_nodes: MutableMapping[int, "Node"] = weakref.WeakValueDictionary()
_nextnode = 0
_processes: MutableMapping[int, nemu.subprocess_.Subprocess]
......
......@@ -96,7 +96,7 @@ _proc_commands = {
KILL_WAIT = 3 # seconds
class Server(object):
class Server:
"""Class that implements the communication protocol and dispatches calls
to the required functions. Also works as the main loop for the slave
process."""
......@@ -556,7 +556,7 @@ class Server(object):
#
# Client-side protocol implementation.
#
class Client(object):
class Client:
"""Client-side implementation of the communication protocol. Acts as a RPC
service."""
......
......@@ -42,7 +42,7 @@ __all__ = ['PIPE', 'STDOUT', 'Popen', 'Subprocess', 'spawn', 'wait', 'poll',
KILL_WAIT = 3 # seconds
class Subprocess(object):
class Subprocess:
"""Class that allows the execution of programs inside a nemu Node. This is
the base class for all process operations, Popen provides a more high level
interface."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment