1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-19 08:59:33 +03:00
Commit Graph

9 Commits

Author SHA1 Message Date
f496dc55ee examples: Cleanup imports
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>
2020-08-05 07:43:02 +00:00
4e22f4de6f examples: Do not use bare except
as it also catches SystemExit, InterruptedError, SyntaxError and such.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
06aba185a8 examples: Convert to ArgumentParser
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>
2020-08-05 07:43:02 +00:00
9cf539a2a8 examples: Add/fix PEP 484 type annotation
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
900676d3c4 examples/consolecallback: Fix assorted errors
Assert stream is opened before receiving bytes.

Need to check for bytes() instead of [unicode]str().

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:01 +00:00
55415a4870 examples/consolecallback: Add var to save callback
> examples/consolecallback.py:98: error: "Console" has no attribute "stdin_watch"

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:01 +00:00
b22e4f2441 Drop support for python 2
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>
2019-12-04 12:14:51 +00:00
3f4e32c6a1 examples: Invoke print("...") instead of print "..."
The 'print' method must be called as a function in python3,
ie with brackets.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-11 16:12:54 +00:00
34aa32ba8a Move python example programs into python/examples/ subdirectory
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:55:39 +00:00