diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
commit | adefe14e308a0f8cf73f9c60693a3dbbded157b9 (patch) | |
tree | cc1ecd798dd05c422ddcf99c1cdbef307aacb8fd /python | |
parent | 42283403886da648bb239177369aa65c0a659255 (diff) | |
download | libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.gz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.xz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.zip |
Generated files for file(1) command.
Diffstat (limited to 'python')
-rw-r--r-- | python/guestfs-py.c | 26 | ||||
-rw-r--r-- | python/guestfs.py | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 9d2738c8..d3d6999c 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -1806,6 +1806,31 @@ py_guestfs_lvm_remove_all (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_file (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + char *r; + const char *path; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_file", + &py_g, &path)) + return NULL; + g = get_handle (py_g); + + r = guestfs_file (g, path); + if (r == NULL) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyString_FromString (r); + free (r); + return py_r; +} + static PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -1869,6 +1894,7 @@ static PyMethodDef methods[] = { { (char *) "mounts", py_guestfs_mounts, METH_VARARGS, NULL }, { (char *) "umount_all", py_guestfs_umount_all, METH_VARARGS, NULL }, { (char *) "lvm_remove_all", py_guestfs_lvm_remove_all, METH_VARARGS, NULL }, + { (char *) "file", py_guestfs_file, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index 864b3619..d4cd46d9 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -207,3 +207,6 @@ class GuestFS: def lvm_remove_all (self): return libguestfsmod.lvm_remove_all (self._o) + def file (self, path): + return libguestfsmod.file (self._o, path) + |