Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
ce9cd5be
Commit
ce9cd5be
authored
14 years ago
by
Brandon Heller
Browse files
Options
Downloads
Patches
Plain Diff
Add command to spawn an xterm
parent
b14b1ee4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mininet/cli.py
+13
-0
13 additions, 0 deletions
mininet/cli.py
mininet/xterm.py
+2
-2
2 additions, 2 deletions
mininet/xterm.py
with
15 additions
and
2 deletions
mininet/cli.py
+
13
−
0
View file @
ce9cd5be
...
...
@@ -34,6 +34,7 @@
from
cmd
import
Cmd
from
mininet.log
import
info
,
output
,
error
from
mininet.xterm
import
makeXterms
class
CLI
(
Cmd
):
...
...
@@ -162,6 +163,18 @@ def do_link( self, args ):
else
:
self
.
mn
.
configLinkStatus
(
*
args
)
def
do_xterm
(
self
,
args
):
"
Spawn xterm for the given node.
"
args
=
args
.
split
()
if
not
args
:
error
(
'
please specify node list: xterm node1 node2 ...
\n
'
)
else
:
for
arg
in
args
:
if
arg
not
in
self
.
nodemap
:
error
(
'
arg not in network: %s
\n
'
%
arg
)
else
:
self
.
mn
.
terms
+=
makeXterms
(
[
self
.
nodemap
[
arg
]
]
)
def
do_exit
(
self
,
args
):
"
Exit
"
return
'
exited by user command
'
...
...
This diff is collapsed.
Click to expand it.
mininet/xterm.py
+
2
−
2
View file @
ce9cd5be
...
...
@@ -9,7 +9,7 @@
from
subprocess
import
Popen
from
mininet.util
import
quietRun
def
makeXterm
(
node
,
title
):
def
makeXterm
(
node
,
title
=
''
):
"""
Run screen on a node, and hook up an xterm.
node: Node object
title: base title
...
...
@@ -34,7 +34,7 @@ def cleanUpScreens():
if
m
:
quietRun
(
'
screen -S
'
+
m
.
group
(
1
)
+
'
-X kill
'
)
def
makeXterms
(
nodes
,
title
):
def
makeXterms
(
nodes
,
title
=
''
):
"""
Create XTerms.
nodes: list of Node objects
title: base title for each
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment