summaryrefslogtreecommitdiff
path: root/examples/consolecallback.py
Commit message (Collapse)AuthorAgeFilesLines
* examples: Fix white spacePhilipp Hahn2020-08-051-4/+10
| | | | | | | indent by 4 spaces one spaces around assignments Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Cleanup importsPhilipp Hahn2020-08-051-1/+6
| | | | | | | | | | Break import into multiple lines as recommended by PEP-8 Move imports to top Remove unused imports Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Do not use bare exceptPhilipp Hahn2020-08-051-1/+1
| | | | | | as it also catches SystemExit, InterruptedError, SyntaxError and such. Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Convert to ArgumentParserPhilipp Hahn2020-08-051-10/+8
| | | | | | | | Replace getopt() and hand-rolled-parser with argparse.ArgumentParser. Fix wrong header comments copy-pasted from domstart.py Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Add/fix PEP 484 type annotationPhilipp Hahn2020-08-051-8/+9
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples/consolecallback: Fix assorted errorsPhilipp Hahn2020-08-051-1/+2
| | | | | | | | Assert stream is opened before receiving bytes. Need to check for bytes() instead of [unicode]str(). Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples/consolecallback: Add var to save callbackPhilipp Hahn2020-08-051-0/+1
| | | | | | > examples/consolecallback.py:98: error: "Console" has no attribute "stdin_watch" Signed-off-by: Philipp Hahn <hahn@univention.de>
* Drop support for python 2Daniel P. Berrangé2019-12-041-1/+1
| | | | | | | | | python2 will be end of life by the time of the next libvirt release. All our supported build targets, including CentOS7, have a python3 build available. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* examples: Invoke print("...") instead of print "..."Daniel P. Berrange2013-12-111-3/+3
| | | | | | | The 'print' method must be called as a function in python3, ie with brackets. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Move python example programs into python/examples/ subdirectoryDaniel P. Berrange2013-11-221-0/+88
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>