Hello community,

here is the log from the commit of package python-cups for openSUSE:Factory
checked in at Tue Oct 4 18:14:41 CEST 2011.



--------
--- openSUSE:Factory/python-cups/python-cups.changes    2011-09-23 
12:42:32.000000000 +0200
+++ /mounts/work_src_done/STABLE/python-cups/python-cups.changes        
2011-10-04 09:46:02.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Oct  4 07:45:18 UTC 2011 - [email protected]
+
+- Update to version 1.9.59:
+  + Password callbacks can now return None to indicate they want to
+    abort the current operation.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  pycups-1.9.58.tar.bz2

New:
----
  pycups-1.9.59.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-cups.spec ++++++
--- /var/tmp/diff_new_pack.jyp84V/_old  2011-10-04 18:14:37.000000000 +0200
+++ /var/tmp/diff_new_pack.jyp84V/_new  2011-10-04 18:14:37.000000000 +0200
@@ -21,7 +21,7 @@
 Name:           python-cups
 %define _name   pycups
 BuildRequires:  cups-devel python-devel
-Version:        1.9.58
+Version:        1.9.59
 Release:        1
 Group:          Development/Libraries/Python
 License:        GPLv2+

++++++ pycups-1.9.58.tar.bz2 -> pycups-1.9.59.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/ChangeLog new/pycups-1.9.59/ChangeLog
--- old/pycups-1.9.58/ChangeLog 2011-07-26 13:20:12.000000000 +0200
+++ new/pycups-1.9.59/ChangeLog 2011-10-03 18:23:22.000000000 +0200
@@ -1,3 +1,14 @@
+2011-10-03  Tim Waugh  <[email protected]>
+
+       * setup.py: Version 1.9.59.
+
+2011-10-03  Tim Waugh  <[email protected]>
+
+       * cupsmodule.c (do_password_callback), cupsconnection.c
+       (password_callback): Return NULL instead of the empty string
+       when handling an exception or when the callback returned an
+       empty string, and handle the callback returning None.
+
 2011-07-26  Tim Waugh  <[email protected]>
 
        * setup.py: Version 1.9.58.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/Makefile new/pycups-1.9.59/Makefile
--- old/pycups-1.9.58/Makefile  2011-07-26 13:28:36.000000000 +0200
+++ new/pycups-1.9.59/Makefile  2011-08-04 13:33:15.000000000 +0200
@@ -13,7 +13,7 @@
 
 cups.so: force
        python setup.py build
-       mv build/lib*/$@ .
+       ln -sf build/lib*/$@ .
 
 doc:   cups.so
        rm -rf html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/NEWS new/pycups-1.9.59/NEWS
--- old/pycups-1.9.58/NEWS      2011-07-19 10:42:45.000000000 +0200
+++ new/pycups-1.9.59/NEWS      2011-10-03 18:23:08.000000000 +0200
@@ -1,6 +1,11 @@
 NEWS
 ----
 
+New in 1.9.59:
+
+* Password callbacks can now return None to indicate they want to
+  abort the current operation.
+
 New in 1.9.58:
 
 * cups.Connection.adminExportSamba
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/PKG-INFO new/pycups-1.9.59/PKG-INFO
--- old/pycups-1.9.58/PKG-INFO  2011-07-26 13:29:19.000000000 +0200
+++ new/pycups-1.9.59/PKG-INFO  2011-10-03 18:32:45.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: pycups
-Version: 1.9.58
+Version: 1.9.59
 Summary: Python bindings for libcups
 Home-page: http://cyberelk.net/tim/software/pycups/
 Author: Tim Waugh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/cupsconnection.c 
new/pycups-1.9.59/cupsconnection.c
--- old/pycups-1.9.58/cupsconnection.c  2011-07-19 10:42:10.000000000 +0200
+++ new/pycups-1.9.59/cupsconnection.c  2011-10-03 18:13:58.000000000 +0200
@@ -366,20 +366,26 @@
   Py_DECREF (args);
   if (result == NULL)
   {
-    debugprintf ("<- password_callback (empty string)\n");
+    debugprintf ("<- password_callback (exception)\n");
     Connection_begin_allow_threads (self);
-    return "";
+    return NULL;
   }
 
-  pwval = PyString_AsString (result);
   free (self->cb_password);
-  self->cb_password = strdup (pwval);
+  if (result == Py_None)
+    self->cb_password = NULL;
+  else
+  {
+    pwval = PyString_AsString (result);
+    self->cb_password = strdup (pwval);
+  }
+
   Py_DECREF (result);
-  if (!self->cb_password)
+  if (!self->cb_password || !*self->cb_password)
   {
-    debugprintf ("<- password_callback (empty string)\n");
+    debugprintf ("<- password_callback (empty/null)\n");
     Connection_begin_allow_threads (self);
-    return "";
+    return NULL;
   }
 
   Connection_begin_allow_threads (self);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/cupsmodule.c 
new/pycups-1.9.59/cupsmodule.c
--- old/pycups-1.9.58/cupsmodule.c      2011-05-24 12:01:42.000000000 +0200
+++ new/pycups-1.9.59/cupsmodule.c      2011-10-03 18:16:52.000000000 +0200
@@ -156,9 +156,9 @@
   Py_DECREF (args);
   if (result == NULL)
   {
-    debugprintf ("<- do_password_callback (empty string)\n");
+    debugprintf ("<- do_password_callback (exception)\n");
     Connection_begin_allow_threads (tls->g_current_connection);
-    return "";
+    return NULL;
   }
 
   if (password) {
@@ -166,14 +166,20 @@
     password = NULL;
   }
 
-  pwval = PyString_AsString (result);
-  password = strdup (pwval);
+  if (result == Py_None)
+    password = NULL;
+  else
+  {
+    pwval = PyString_AsString (result);
+    password = strdup (pwval);
+  }
+
   Py_DECREF (result);
-  if (!password)
+  if (!password || !*password)
   {
-    debugprintf ("<- do_password_callback (empty string)\n");
+    debugprintf ("<- do_password_callback (empty/null)\n");
     Connection_begin_allow_threads (tls->g_current_connection);
-    return "";
+    return NULL;
   }
 
   Connection_begin_allow_threads (tls->g_current_connection);
@@ -513,8 +519,8 @@
     "setPasswordCB(fn) -> None\n\n"
     "Set password callback function.  This Python function will be called \n"
     "when a password is required.  It must take one string parameter \n"
-    "(the password prompt) and it must return a string (the password).  To \n"
-    "abort the operation it may return the empty string ('').\n\n"
+    "(the password prompt) and it must return a string (the password), or \n"
+    "None to abort the operation.\n\n"
     "@type fn: callable object\n"
     "@param fn: callback function" },
 
@@ -523,10 +529,10 @@
     "setPasswordCB2(fn, context=None) -> None\n\n"
     "Set password callback function.  This Python function will be called \n"
     "when a password is required.  It must take parameters of type string \n"
-    "(the password prompt), instance (the cups.Connection), string (the HTTP "
-    "method), string (the HTTP resource) and, optionally, the user-supplied "
-    "context.  It must return a string (the password).  To \n"
-    "abort the operation it may return the empty string ('').\n\n"
+    "(the password prompt), instance (the cups.Connection), string (the \n"
+    "HTTP method), string (the HTTP resource) and, optionally, the user-\n"
+    "supplied context.  It must return a string (the password), or None \n"
+    "to abort the operation.\n\n"
     "@type fn: callable object, or None for default handler\n"
     "@param fn: callback function" },
 #endif /* HAVE_CUPS_1_4 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycups-1.9.58/setup.py new/pycups-1.9.59/setup.py
--- old/pycups-1.9.58/setup.py  2011-07-26 13:23:35.000000000 +0200
+++ new/pycups-1.9.59/setup.py  2011-10-03 18:22:41.000000000 +0200
@@ -35,7 +35,7 @@
 
 from distutils.core import setup, Extension
 import sys
-VERSION="1.9.58"
+VERSION="1.9.59"
 libraries=["cups"]
 
 if sys.platform == "darwin":

continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to