Commit 39ffde30 by Stéphane Graber

python: Update scripts to respect PEP-8 spec

parent b0f9616f
...@@ -11,9 +11,11 @@ import vte ...@@ -11,9 +11,11 @@ import vte
import lxc import lxc
import sys import sys
def gtk_exit_cb(terminal): def gtk_exit_cb(terminal):
gtk.main_quit() gtk.main_quit()
def vte_con(ct, ttynum): def vte_con(ct, ttynum):
print("Doing console in a VTE widget...") print("Doing console in a VTE widget...")
masterfd = ct.console_getfd(ttynum) masterfd = ct.console_getfd(ttynum)
......
...@@ -22,7 +22,8 @@ if __name__ == '__main__': ...@@ -22,7 +22,8 @@ if __name__ == '__main__':
ct = lxc.Container(sys.argv[1]) 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) time.sleep(1)
if not ct.defined: if not ct.defined:
sys.exit("Container %s not defined" % ct.name) sys.exit("Container %s not defined" % ct.name)
......
...@@ -292,7 +292,7 @@ class Container(_lxc.Container): ...@@ -292,7 +292,7 @@ class Container(_lxc.Container):
self.load_config() self.load_config()
return True 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. Attach to console of running container.
""" """
...@@ -300,9 +300,10 @@ class Container(_lxc.Container): ...@@ -300,9 +300,10 @@ class Container(_lxc.Container):
if not self.running: if not self.running:
return False 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. Attach to console of running container.
""" """
......
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