summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-08 04:26:22 +0000
committerTim Potter <tpot@samba.org>2002-05-08 04:26:22 +0000
commit1359433ad8c4f66922564a5f9c1bba7a7b2563e5 (patch)
tree99c8783264087aca7c3924603992b54cdee04a49 /source3/python
parent8e917f27f2d54180829696d23073f671df5b9216 (diff)
downloadsamba-1359433ad8c4f66922564a5f9c1bba7a7b2563e5.tar.gz
samba-1359433ad8c4f66922564a5f9c1bba7a7b2563e5.tar.bz2
samba-1359433ad8c4f66922564a5f9c1bba7a7b2563e5.zip
Added setjob() command.
(This used to be commit 02c63de9e58f9806e58d3862391e05e9b9cdb8fc)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_spoolss.c11
-rw-r--r--source3/python/py_spoolss_jobs.c30
-rw-r--r--source3/python/py_spoolss_proto.h1
3 files changed, 42 insertions, 0 deletions
diff --git a/source3/python/py_spoolss.c b/source3/python/py_spoolss.c
index b1c70f9d4e..51e128ecc0 100644
--- a/source3/python/py_spoolss.c
+++ b/source3/python/py_spoolss.c
@@ -191,6 +191,9 @@ Set the form given by the dictionary argument.
{ "enumjobs", spoolss_enumjobs, METH_VARARGS | METH_KEYWORDS,
"Enumerate jobs" },
+ { "setjob", spoolss_setjob, METH_VARARGS | METH_KEYWORDS,
+ "Set job command" },
+
{ NULL }
};
@@ -325,6 +328,14 @@ struct spoolss_const {
{ "WERR_PRINTER_DRIVER_IN_USE", 3001 },
{ "WERR_STATUS_MORE_ENTRIES ", 0x0105 },
+ /* Job control constants */
+
+ { "JOB_CONTROL_PAUSE", JOB_CONTROL_PAUSE },
+ { "JOB_CONTROL_RESUME", JOB_CONTROL_RESUME },
+ { "JOB_CONTROL_CANCEL", JOB_CONTROL_CANCEL },
+ { "JOB_CONTROL_RESTART", JOB_CONTROL_RESTART },
+ { "JOB_CONTROL_DELETE", JOB_CONTROL_DELETE },
+
{ NULL },
};
diff --git a/source3/python/py_spoolss_jobs.c b/source3/python/py_spoolss_jobs.c
index e049d82a33..3e436849b1 100644
--- a/source3/python/py_spoolss_jobs.c
+++ b/source3/python/py_spoolss_jobs.c
@@ -84,3 +84,33 @@ PyObject *spoolss_enumjobs(PyObject *self, PyObject *args, PyObject *kw)
Py_INCREF(result);
return result;
}
+
+/* Set job command */
+
+PyObject *spoolss_setjob(PyObject *self, PyObject *args, PyObject *kw)
+{
+ spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self;
+ WERROR werror;
+ PyObject *result;
+ uint32 level = 0, command, jobid;
+ static char *kwlist[] = {"jobid", "command", "level", NULL};
+
+ /* Parse parameters */
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "ii|i", kwlist, &jobid,
+ &command, &level))
+ return NULL;
+
+ /* Call rpc function */
+
+ werror = cli_spoolss_setjob(hnd->cli, hnd->mem_ctx, &hnd->pol,
+ jobid, level, command);
+
+ if (!W_ERROR_IS_OK(werror)) {
+ PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
+ return NULL;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
diff --git a/source3/python/py_spoolss_proto.h b/source3/python/py_spoolss_proto.h
index 81d34a2c2d..913b7822c2 100644
--- a/source3/python/py_spoolss_proto.h
+++ b/source3/python/py_spoolss_proto.h
@@ -48,6 +48,7 @@ BOOL py_to_FORM(FORM *form, PyObject *dict);
/* The following definitions come from python/py_spoolss_jobs.c */
PyObject *spoolss_enumjobs(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_setjob(PyObject *self, PyObject *args, PyObject *kw);
/* The following definitions come from python/py_spoolss_jobs_conv.c */