mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
python: Let RHashtable be returned as a Python dict.
The initial proposal was suggested by Matt Booth and discussed on the mailing list here: https://www.redhat.com/archives/libguestfs/2013-April/msg00007.html
This commit is contained in:
@@ -7,7 +7,7 @@ guestfs-python - How to use libguestfs from Python
|
||||
=head1 SYNOPSIS
|
||||
|
||||
import guestfs
|
||||
g = guestfs.GuestFS ()
|
||||
g = guestfs.GuestFS (python_return_dict=True)
|
||||
g.add_drive_opts ("disk.img", format="raw", readonly=1)
|
||||
g.launch ()
|
||||
|
||||
@@ -18,6 +18,17 @@ programming language. This page just documents the differences from
|
||||
the C API and gives some examples. If you are not familiar with using
|
||||
libguestfs, you also need to read L<guestfs(3)>.
|
||||
|
||||
=head2 python_return_dict=True
|
||||
|
||||
All new code should construct the handle using:
|
||||
|
||||
g = guestfs.GuestFS (python_return_dict=True)
|
||||
|
||||
This indicates that your program wants to receive Python dicts for
|
||||
methods in the API that return hashtables.
|
||||
|
||||
In a future version of libguestfs, this will become the default.
|
||||
|
||||
=head2 EXCEPTIONS
|
||||
|
||||
Errors from libguestfs functions are mapped into C<RuntimeException>
|
||||
|
||||
Reference in New Issue
Block a user