From: Stéphane Graber Date: Mon, 8 Jul 2013 14:46:20 +0000 (-0400) Subject: python: Update scripts to respect PEP-8 spec X-Git-Tag: lxc-1.0.0.alpha1~1^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39ffde307ad83bd407aaa6a0d81682902bab248b;p=thirdparty%2Flxc.git python: Update scripts to respect PEP-8 spec Signed-off-by: Stéphane Graber --- diff --git a/src/python-lxc/examples/pyconsole-vte.py b/src/python-lxc/examples/pyconsole-vte.py index 79267587a..9938e6af0 100755 --- a/src/python-lxc/examples/pyconsole-vte.py +++ b/src/python-lxc/examples/pyconsole-vte.py @@ -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) diff --git a/src/python-lxc/examples/pyconsole.py b/src/python-lxc/examples/pyconsole.py index 7661ef48d..36d4838c1 100755 --- a/src/python-lxc/examples/pyconsole.py +++ b/src/python-lxc/examples/pyconsole.py @@ -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) diff --git a/src/python-lxc/lxc/__init__.py b/src/python-lxc/lxc/__init__.py index c15cfad0b..9ada7ffef 100644 --- a/src/python-lxc/lxc/__init__.py +++ b/src/python-lxc/lxc/__init__.py @@ -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. """