summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 10:09:13 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 10:09:13 +0100
commitf450ce75b754fb869b34433c0126f7bb592b141b (patch)
treed5871faf1cc109629f7df0b59e1eb1403199ccf4 /python
parent62ccc07e744d5ebfb45d9344827d36f9f61699f4 (diff)
downloadlibguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.tar.gz
libguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.tar.xz
libguestfs-f450ce75b754fb869b34433c0126f7bb592b141b.zip
Generated code for 'wc_*' commands.
Diffstat (limited to 'python')
-rw-r--r--python/guestfs-py.c75
-rw-r--r--python/guestfs.py18
2 files changed, 93 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c
index 263d3d9f..07f3c460 100644
--- a/python/guestfs-py.c
+++ b/python/guestfs-py.c
@@ -4631,6 +4631,78 @@ py_guestfs_mkdtemp (PyObject *self, PyObject *args)
return py_r;
}
+static PyObject *
+py_guestfs_wc_l (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *path;
+
+ if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_wc_l",
+ &py_g, &path))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_wc_l (g, path);
+ if (r == -1) {
+ PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+ return NULL;
+ }
+
+ py_r = PyInt_FromLong ((long) r);
+ return py_r;
+}
+
+static PyObject *
+py_guestfs_wc_w (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *path;
+
+ if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_wc_w",
+ &py_g, &path))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_wc_w (g, path);
+ if (r == -1) {
+ PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+ return NULL;
+ }
+
+ py_r = PyInt_FromLong ((long) r);
+ return py_r;
+}
+
+static PyObject *
+py_guestfs_wc_c (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *path;
+
+ if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_wc_c",
+ &py_g, &path))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_wc_c (g, path);
+ if (r == -1) {
+ PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+ return NULL;
+ }
+
+ py_r = PyInt_FromLong ((long) r);
+ return py_r;
+}
+
static PyMethodDef methods[] = {
{ (char *) "create", py_guestfs_create, METH_VARARGS, NULL },
{ (char *) "close", py_guestfs_close, METH_VARARGS, NULL },
@@ -4803,6 +4875,9 @@ static PyMethodDef methods[] = {
{ (char *) "scrub_file", py_guestfs_scrub_file, METH_VARARGS, NULL },
{ (char *) "scrub_freespace", py_guestfs_scrub_freespace, METH_VARARGS, NULL },
{ (char *) "mkdtemp", py_guestfs_mkdtemp, METH_VARARGS, NULL },
+ { (char *) "wc_l", py_guestfs_wc_l, METH_VARARGS, NULL },
+ { (char *) "wc_w", py_guestfs_wc_w, METH_VARARGS, NULL },
+ { (char *) "wc_c", py_guestfs_wc_c, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
};
diff --git a/python/guestfs.py b/python/guestfs.py
index 23aef9c2..01318ce1 100644
--- a/python/guestfs.py
+++ b/python/guestfs.py
@@ -1727,3 +1727,21 @@ class GuestFS:
"""
return libguestfsmod.mkdtemp (self._o, template)
+ def wc_l (self, path):
+ u"""This command counts the lines in a file, using the "wc
+ -l" external command.
+ """
+ return libguestfsmod.wc_l (self._o, path)
+
+ def wc_w (self, path):
+ u"""This command counts the words in a file, using the "wc
+ -w" external command.
+ """
+ return libguestfsmod.wc_w (self._o, path)
+
+ def wc_c (self, path):
+ u"""This command counts the characters in a file, using the
+ "wc -c" external command.
+ """
+ return libguestfsmod.wc_c (self._o, path)
+