Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
0301f87d
Commit
0301f87d
authored
Jul 01, 2024
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove object base class
parent
bb2a6abf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
src/nemu/__init__.py
src/nemu/__init__.py
+1
-1
src/nemu/interface.py
src/nemu/interface.py
+1
-1
src/nemu/iproute.py
src/nemu/iproute.py
+2
-2
src/nemu/node.py
src/nemu/node.py
+1
-1
src/nemu/protocol.py
src/nemu/protocol.py
+2
-2
src/nemu/subprocess_.py
src/nemu/subprocess_.py
+1
-1
No files found.
src/nemu/__init__.py
View file @
0301f87d
...
@@ -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
):
...
...
src/nemu/interface.py
View file @
0301f87d
...
@@ -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
...
...
src/nemu/iproute.py
View file @
0301f87d
...
@@ -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"
]
...
...
src/nemu/node.py
View file @
0301f87d
...
@@ -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
]
...
...
src/nemu/protocol.py
View file @
0301f87d
...
@@ -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."""
...
...
src/nemu/subprocess_.py
View file @
0301f87d
...
@@ -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."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment