source: branches/samba-3.0/source/python/py_spoolss.c@ 447

Last change on this file since 447 was 1, checked in by Paul Smedley, 19 years ago

Initial code import

File size: 14.3 KB
Line 
1/*
2 Python wrappers for DCERPC/SMB client routines.
3
4 Copyright (C) Tim Potter, 2002
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include "python/py_spoolss.h"
22
23/* Exceptions this module can raise */
24
25PyObject *spoolss_error, *spoolss_werror;
26
27/*
28 * Method dispatch table
29 */
30
31static PyMethodDef spoolss_methods[] = {
32
33 /* Open/close printer handles */
34
35 { "openprinter", (PyCFunction)spoolss_openprinter, METH_VARARGS | METH_KEYWORDS,
36 "Open a printer by name in UNC format.\n"
37"\n"
38"Optionally a dictionary of (domain, username, password) may be given in\n"
39"which case they are used when opening the RPC pipe. An access mask may\n"
40"also be given which defaults to MAXIMUM_ALLOWED_ACCESS.\n"
41"\n"
42"Example:\n"
43"\n"
44">>> hnd = spoolss.openprinter(\"\\\\\\\\NPSD-PDC2\\\\meanie\")"},
45
46 { "closeprinter", spoolss_closeprinter, METH_VARARGS,
47 "Close a printer handle opened with openprinter or addprinter.\n"
48"\n"
49"Example:\n"
50"\n"
51">>> spoolss.closeprinter(hnd)"},
52
53 { "addprinterex", (PyCFunction)spoolss_addprinterex, METH_VARARGS,
54 "addprinterex()"},
55
56 /* Server enumeratation functions */
57
58 { "enumprinters", (PyCFunction)spoolss_enumprinters,
59 METH_VARARGS | METH_KEYWORDS,
60 "Enumerate printers on a print server.\n"
61"\n"
62"Return a list of printers on a print server. The credentials, info level\n"
63"and flags may be specified as keyword arguments.\n"