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

Remove object base class

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