Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
39ffde30
Commit
39ffde30
authored
Jul 08, 2013
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: Update scripts to respect PEP-8 spec
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
b0f9616f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
pyconsole-vte.py
src/python-lxc/examples/pyconsole-vte.py
+2
-0
pyconsole.py
src/python-lxc/examples/pyconsole.py
+2
-1
__init__.py
src/python-lxc/lxc/__init__.py
+4
-3
No files found.
src/python-lxc/examples/pyconsole-vte.py
View file @
39ffde30
...
...
@@ -11,9 +11,11 @@ import vte
import
lxc
import
sys
def
gtk_exit_cb
(
terminal
):
gtk
.
main_quit
()
def
vte_con
(
ct
,
ttynum
):
print
(
"Doing console in a VTE widget..."
)
masterfd
=
ct
.
console_getfd
(
ttynum
)
...
...
src/python-lxc/examples/pyconsole.py
View file @
39ffde30
...
...
@@ -22,7 +22,8 @@ if __name__ == '__main__':
ct
=
lxc
.
Container
(
sys
.
argv
[
1
])
print
(
"Container:
%
s tty:
%
d Ctrl-
%
c q to quit"
%
(
ct
.
name
,
ttynum
,
ord
(
'a'
)
+
escape
-
1
))
print
(
"Container:
%
s tty:
%
d Ctrl-
%
c q to quit"
%
(
ct
.
name
,
ttynum
,
ord
(
'a'
)
+
escape
-
1
))
time
.
sleep
(
1
)
if
not
ct
.
defined
:
sys
.
exit
(
"Container
%
s not defined"
%
ct
.
name
)
...
...
src/python-lxc/lxc/__init__.py
View file @
39ffde30
...
...
@@ -292,7 +292,7 @@ class Container(_lxc.Container):
self
.
load_config
()
return
True
def
console
(
self
,
ttynum
=
-
1
,
stdinfd
=
0
,
stdoutfd
=
1
,
stderrfd
=
2
,
escape
=
1
):
def
console
(
self
,
ttynum
=-
1
,
stdinfd
=
0
,
stdoutfd
=
1
,
stderrfd
=
2
,
escape
=
1
):
"""
Attach to console of running container.
"""
...
...
@@ -300,9 +300,10 @@ class Container(_lxc.Container):
if
not
self
.
running
:
return
False
return
_lxc
.
Container
.
console
(
self
,
ttynum
,
stdinfd
,
stdoutfd
,
stderrfd
,
escape
)
return
_lxc
.
Container
.
console
(
self
,
ttynum
,
stdinfd
,
stdoutfd
,
stderrfd
,
escape
)
def
console_getfd
(
self
,
ttynum
=
-
1
):
def
console_getfd
(
self
,
ttynum
=
-
1
):
"""
Attach to console of running container.
"""
...
...
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