commit python-cups for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package python-cups for openSUSE:Factory checked in at Wed Nov 10 18:41:12 CET 2010. -------- --- python-cups/python-cups.changes 2010-09-03 20:04:03.000000000 +0200 +++ python-cups/python-cups.changes 2010-11-10 14:03:08.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Nov 10 14:02:13 CET 2010 - vuntz@opensuse.org + +- Update to version 1.9.52: + + cups.Connection.getPPDs2(): New method, identical to getPPDs() + but returning all attribute values as lists. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- pycups-1.9.51.tar.bz2 New: ---- pycups-1.9.52.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cups.spec ++++++ --- /var/tmp/diff_new_pack.pBGcuI/_old 2010-11-10 18:40:24.000000000 +0100 +++ /var/tmp/diff_new_pack.pBGcuI/_new 2010-11-10 18:40:24.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-cups (Version 1.9.51) +# spec file for package python-cups (Version 1.9.52) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -21,8 +21,8 @@ Name: python-cups %define _name pycups BuildRequires: cups-devel python-devel -Version: 1.9.51 -Release: 2 +Version: 1.9.52 +Release: 1 Group: Development/Libraries/Python License: GPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ pycups-1.9.51.tar.bz2 -> pycups-1.9.52.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycups-1.9.51/ChangeLog new/pycups-1.9.52/ChangeLog --- old/pycups-1.9.51/ChangeLog 2010-05-11 17:33:28.000000000 +0200 +++ new/pycups-1.9.52/ChangeLog 2010-11-01 14:30:44.000000000 +0100 @@ -1,3 +1,12 @@ +2010-11-01 Tim Waugh <twaugh@redhat.com> + + * setup.py: Version 1.9.52. + +2010-10-18 Tim Waugh <twaugh@redhat.com> + + * cupsconnection.c (Connection.getPPDs2): New method as + getPPDs but with attribute values as lists. + 2010-05-11 Tim Waugh <twaugh@redhat.com> * cupsmodule.c: New HTTP_NOT_MODIFIED int constant. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycups-1.9.51/NEWS new/pycups-1.9.52/NEWS --- old/pycups-1.9.51/NEWS 2010-05-18 17:00:34.000000000 +0200 +++ new/pycups-1.9.52/NEWS 2010-10-20 13:53:35.000000000 +0200 @@ -1,6 +1,11 @@ NEWS ---- +New in 1.9.52: + +* cups.Connection.getPPDs2(): New method, identical to getPPDs() but + returning all attribute values as lists. + New in 1.9.50: * cups.Connection.getPPD3() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycups-1.9.51/cupsconnection.c new/pycups-1.9.52/cupsconnection.c --- old/pycups-1.9.51/cupsconnection.c 2010-05-19 17:25:17.000000000 +0200 +++ new/pycups-1.9.52/cupsconnection.c 2010-10-20 16:17:12.000000000 +0200 @@ -549,18 +549,63 @@ } static PyObject * -build_list_from_attribute_strings (ipp_attribute_t *attr) +PyObject_from_attr_value (ipp_attribute_t *attr, int i) +{ + PyObject *val = NULL; + switch (attr->value_tag) { + case IPP_TAG_NAME: + case IPP_TAG_TEXT: + case IPP_TAG_KEYWORD: + case IPP_TAG_URI: + case IPP_TAG_CHARSET: + case IPP_TAG_MIMETYPE: + case IPP_TAG_LANGUAGE: + val = PyObj_from_UTF8 (attr->values[i].string.text); + break; + case IPP_TAG_INTEGER: + case IPP_TAG_ENUM: + val = PyInt_FromLong (attr->values[i].integer); + break; + case IPP_TAG_BOOLEAN: + val = PyBool_FromLong (attr->values[i].integer); + break; + case IPP_TAG_RANGE: + val = Py_BuildValue ("(ii)", + attr->values[i].range.lower, + attr->values[i].range.upper); + break; + case IPP_TAG_NOVALUE: + Py_INCREF (Py_None); + val = Py_None; + break; + + // TODO: + case IPP_TAG_DATE: + val = PyString_FromString ("(IPP_TAG_DATE)"); + break; + default: + val = PyString_FromString ("(unknown IPP tag)"); + break; + } + + return val; +} + +static PyObject * +PyList_from_attr_values (ipp_attribute_t *attr) { PyObject *list = PyList_New (0); int i; - debugprintf ("-> build_list_from_attribute_strings()\n"); + debugprintf ("-> PyList_from_attr_values()\n"); for (i = 0; i < attr->num_values; i++) { - PyObject *val = PyObj_from_UTF8 (attr->values[i].string.text); - PyList_Append (list, val); - Py_DECREF (val); - debugprintf ("%s\n", attr->values[i].string.text); + PyObject *val = PyObject_from_attr_value (attr, i); + if (val) { + PyList_Append (list, val); + Py_DECREF (val); + } } - debugprintf ("<- build_list_from_attribute_strings()\n"); + + debugprintf ("<- PyList_from_attr_values()\n"); return list; } @@ -648,7 +693,7 @@ else if (!strcmp (attr->name, "printer-state-reasons") && attr->value_tag == IPP_TAG_KEYWORD) { - val = build_list_from_attribute_strings (attr); + val = PyList_from_attr_values (attr); } else if (!strcmp (attr->name, "printer-is-accepting-jobs") && @@ -758,7 +803,7 @@ else if (!strcmp (attr->name, "member-names") && attr->value_tag == IPP_TAG_NAME) { Py_XDECREF (members); - members = build_list_from_attribute_strings (attr); + members = PyList_from_attr_values (attr); } } @@ -788,50 +833,7 @@ } static PyObject * -PyObject_from_attr_value (ipp_attribute_t *attr, int i) -{ - PyObject *val = NULL; - switch (attr->value_tag) { - case IPP_TAG_NAME: - case IPP_TAG_TEXT: - case IPP_TAG_KEYWORD: - case IPP_TAG_URI: - case IPP_TAG_CHARSET: - case IPP_TAG_MIMETYPE: - case IPP_TAG_LANGUAGE: - val = PyObj_from_UTF8 (attr->values[i].string.text); - break; - case IPP_TAG_INTEGER: - case IPP_TAG_ENUM: - val = PyInt_FromLong (attr->values[i].integer); - break; - case IPP_TAG_BOOLEAN: - val = PyBool_FromLong (attr->values[i].integer); - break; - case IPP_TAG_RANGE: - val = Py_BuildValue ("(ii)", - attr->values[i].range.lower, - attr->values[i].range.upper); - break; - case IPP_TAG_NOVALUE: - Py_INCREF (Py_None); - val = Py_None; - break; - - // TODO: - case IPP_TAG_DATE: - val = PyString_FromString ("(IPP_TAG_DATE)"); - break; - default: - val = PyString_FromString ("(unknown IPP tag)"); - break; - } - - return val; -} - -static PyObject * -Connection_getPPDs (Connection *self, PyObject *args, PyObject *kwds) +do_getPPDs (Connection *self, PyObject *args, PyObject *kwds, int all_lists) { PyObject *result = NULL; ipp_t *request, *answer; @@ -1062,18 +1064,21 @@ for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next) { PyObject *val = NULL; - debugprintf ("Attribute: %s\n", attr->name); if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME) ppdname = attr->values[0].string.text; - else - val = PyObject_from_attr_value (attr, 0); + else { + if (all_lists) + val = PyList_from_attr_values (attr); + else + val = PyObject_from_attr_value (attr, 0); - if (val) { - debugprintf ("Adding %s to ppd dict\n", attr->name); - PyDict_SetItemString (dict, attr->name, val); - Py_DECREF (val); + if (val) { + debugprintf ("Adding %s to ppd dict\n", attr->name); + PyDict_SetItemString (dict, attr->name, val); + Py_DECREF (val); + } } } @@ -1095,6 +1100,18 @@ } static PyObject * +Connection_getPPDs (Connection *self, PyObject *args, PyObject *kwds) +{ + return do_getPPDs (self, args, kwds, 0); +} + +static PyObject * +Connection_getPPDs2 (Connection *self, PyObject *args, PyObject *kwds) +{ + return do_getPPDs (self, args, kwds, 1); +} + +static PyObject * Connection_getServerPPD (Connection *self, PyObject *args) { #if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 3) @@ -1540,15 +1557,9 @@ attr->value_tag == IPP_TAG_BOOLEAN) val = PyBool_FromLong (attr->values[0].integer); else { - if (attr->num_values > 1) { - int i; - val = PyList_New (0); - for (i = 0; i < attr->num_values; i++) { - PyObject *item = PyObject_from_attr_value (attr, i); - if (item) - PyList_Append (val, item); - } - } else + if (attr->num_values > 1) + val = PyList_from_attr_values (attr); + else val = PyObject_from_attr_value (attr, 0); } @@ -1629,15 +1640,9 @@ PyObject *obj; if (attr->num_values > 1 || - !strcmp (attr->name, "job-printer-state-reasons")) { - int i; - obj = PyList_New (0); - for (i = 0; i < attr->num_values; i++) { - PyObject *item = PyObject_from_attr_value (attr, i); - if (item) - PyList_Append (obj, item); - } - } else + !strcmp (attr->name, "job-printer-state-reasons")) + obj = PyList_from_attr_values (attr); + else obj = PyObject_from_attr_value (attr, 0); if (!obj) @@ -3153,12 +3158,7 @@ } if (is_list) { - PyObject *list = PyList_New (0); - int i; - for (i = 0; i < attr->num_values; i++) { - PyObject *val = PyObject_from_attr_value (attr, i); - PyList_Append (list, val); - } + PyObject *list = PyList_from_attr_values (attr); PyDict_SetItemString (ret, attr->name, list); Py_DECREF (list); } else { @@ -3807,7 +3807,6 @@ ipp_t *request, *answer; ipp_attribute_t *attr; PyObject *result, *subscription; - int i; static char *kwlist[] = { "uri", "my_subscriptions", "job_id", NULL }; if (!PyArg_ParseTupleAndKeywords (args, kwds, "O|Oi", kwlist, @@ -3868,14 +3867,8 @@ continue; } - if (attr->num_values > 1 || !strcmp (attr->name, "notify-events")) { - obj = PyList_New (0); - for (i = 0; i < attr->num_values; i++) { - PyObject *item = PyObject_from_attr_value (attr, i); - if (item) - PyList_Append (obj, item); - } - } + if (attr->num_values > 1 || !strcmp (attr->name, "notify-events")) + obj = PyList_from_attr_values (attr); else obj = PyObject_from_attr_value (attr, 0); @@ -4149,16 +4142,8 @@ if (attr->num_values > 1 || !strcmp (attr->name, "notify-events") || !strcmp (attr->name, "printer-state-reasons") || - !strcmp (attr->name, "job-printer-state-reasons")) { - obj = PyList_New (0); - for (i = 0; i < attr->num_values; i++) { - PyObject *item = PyObject_from_attr_value (attr, i); - if (item) { - PyList_Append (obj, item); - Py_DECREF (item); - } - } - } + !strcmp (attr->name, "job-printer-state-reasons")) + obj = PyList_from_attr_values (attr); else obj = PyObject_from_attr_value (attr, 0); @@ -4513,6 +4498,40 @@ "PPDs, indexed by attribute.\n" "@raise IPPError: IPP problem" }, + { "getPPDs2", + (PyCFunction) Connection_getPPDs2, METH_VARARGS | METH_KEYWORDS, + "getPPDs(limit=0, exclude_schemes=None, include_schemes=None, \n" + "ppd_natural_language=None, ppd_device_id=None, ppd_make=None, \n" + "ppd_make_and_model=None, ppd_model_number=-1, ppd_product=None, \n" + "ppd_psversion=None, ppd_type=None) -> dict\n\n" + "@type limit: integer\n" + "@param limit: maximum number of PPDs to return\n" + "@type exclude_schemes: string list\n" + "@param exclude_schemes: list of PPD schemes to exclude\n" + "@type include_schemes: string list\n" + "@param include_schemes: list of PPD schemes to include\n" + "@type ppd_natural_language: string\n" + "@param ppd_natural_language: required language\n" + "@type ppd_device_id: string\n" + "@param ppd_device_id: IEEE 1284 Device ID to match against\n" + "@type ppd_make: string\n" + "@param ppd_make: required printer manufacturer\n" + "@type ppd_make_and_model: string\n" + "@param ppd_make_and_model: required make and model\n" + "@type ppd_model_number: integer\n" + "@param ppd_model_number: model number required (from cupsModelNumber \n" + "in PPD file)\n" + "@type ppd_product: string\n" + "@param ppd_product: required PostScript product string (Product)\n" + "@type ppd_psversion: string\n" + "@param ppd_psversion: required PostScript version (PSVersion)\n" + "@type ppd_type: string\n" + "@param ppd_type: required type of PPD. Valid values are fax; pdf; \n" + "postscript; raster; unknown.\n" + "@return: a dict, indexed by PPD name, of dicts representing\n" + "PPDs, indexed by attribute. All attribute values are lists.\n" + "@raise IPPError: IPP problem" }, + { "getServerPPD", (PyCFunction) Connection_getServerPPD, METH_VARARGS, "getServerPPD(ppd_name) -> string\n\n" @@ -5019,7 +5038,9 @@ { "createSubscription", (PyCFunction) Connection_createSubscription, METH_VARARGS | METH_KEYWORDS, - "createSubscription(uri) -> integer\n\n" + "createSubscription(uri, events=[], job_id=-1, recipient_uri="",\n" + " lease_duration=-1, time_interval=-1,\n" + " user_data="") -> integer\n\n" "Create a subscription.\n\n" "@type uri: string\n" "@param uri: URI for object\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycups-1.9.51/setup.py new/pycups-1.9.52/setup.py --- old/pycups-1.9.51/setup.py 2010-06-25 17:17:24.000000000 +0200 +++ new/pycups-1.9.52/setup.py 2010-11-01 14:30:37.000000000 +0100 @@ -1,5 +1,5 @@ from distutils.core import setup, Extension -VERSION="1.9.51" +VERSION="1.9.52" setup (name="pycups", version=VERSION, ext_modules=[Extension("cups", ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de