Hello community,

here is the log from the commit of package python-PyScreeze for 
openSUSE:Factory checked in at 2019-03-11 13:51:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PyScreeze (Old)
 and      /work/SRC/openSUSE:Factory/.python-PyScreeze.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-PyScreeze"

Mon Mar 11 13:51:25 2019 rev:5 rq:683737 version:0.1.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PyScreeze/python-PyScreeze.changes        
2019-03-05 12:25:27.852838824 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-PyScreeze.new.28833/python-PyScreeze.changes 
    2019-03-11 13:51:36.469258395 +0100
@@ -1,0 +2,7 @@
+Mon Mar 11 09:38:34 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.1.20:
+  * Going back to the old "return None" behavior, but adding
+    USE_IMAGE_NOT_FOUND_EXCEPTION to make raising exceptions possible too
+
+-------------------------------------------------------------------

Old:
----
  PyScreeze-0.1.19.tar.gz

New:
----
  PyScreeze-0.1.20.tar.gz

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

Other differences:
------------------
++++++ python-PyScreeze.spec ++++++
--- /var/tmp/diff_new_pack.arwsdk/_old  2019-03-11 13:51:37.273257869 +0100
+++ /var/tmp/diff_new_pack.arwsdk/_new  2019-03-11 13:51:37.273257869 +0100
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-PyScreeze
-Version:        0.1.19
+Version:        0.1.20
 Release:        0
 Summary:        A screenshot Python module
 License:        BSD-3-Clause

++++++ PyScreeze-0.1.19.tar.gz -> PyScreeze-0.1.20.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/PyScreeze-0.1.19/PKG-INFO 
new/PyScreeze-0.1.20/PKG-INFO
--- old/PyScreeze-0.1.19/PKG-INFO       2019-01-05 19:55:56.000000000 +0100
+++ new/PyScreeze-0.1.20/PKG-INFO       2019-03-08 06:14:58.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: PyScreeze
-Version: 0.1.19
+Version: 0.1.20
 Summary: A simple, cross-platform screenshot module for Python 2 and 3.
 Home-page: https://github.com/asweigart/pyscreeze
 Author: Al Sweigart
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/PyScreeze-0.1.19/PyScreeze.egg-info/PKG-INFO 
new/PyScreeze-0.1.20/PyScreeze.egg-info/PKG-INFO
--- old/PyScreeze-0.1.19/PyScreeze.egg-info/PKG-INFO    2019-01-05 
19:55:56.000000000 +0100
+++ new/PyScreeze-0.1.20/PyScreeze.egg-info/PKG-INFO    2019-03-08 
06:14:57.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: PyScreeze
-Version: 0.1.19
+Version: 0.1.20
 Summary: A simple, cross-platform screenshot module for Python 2 and 3.
 Home-page: https://github.com/asweigart/pyscreeze
 Author: Al Sweigart
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/PyScreeze-0.1.19/pyscreeze/__init__.py 
new/PyScreeze-0.1.20/pyscreeze/__init__.py
--- old/PyScreeze-0.1.19/pyscreeze/__init__.py  2019-01-03 20:32:07.000000000 
+0100
+++ new/PyScreeze-0.1.20/pyscreeze/__init__.py  2019-03-08 05:57:59.000000000 
+0100
@@ -10,7 +10,7 @@
 http://ubuntuforums.org/showthread.php?t=1751455
 """
 
-__version__ = '0.1.19'
+__version__ = '0.1.20'
 
 import collections
 import datetime
@@ -44,6 +44,12 @@
 
 GRAYSCALE_DEFAULT = False
 
+# For version 0.1.19 I changed it so that ImageNotFoundException was raised
+# instead of returning None. In hindsight, this change came too late, so I'm
+# changing it back to returning None. But I'm also including this option for
+# folks who would rather have it raise an exception.
+USE_IMAGE_NOT_FOUND_EXCEPTION = False
+
 scrotExists = False
 try:
     if sys.platform not in ('java', 'darwin', 'win32'):
@@ -150,7 +156,10 @@
     matches = numpy.unravel_index(match_indices[:limit], result.shape)
 
     if len(matches[0]) == 0:
-        raise ImageNotFoundException('Could not locate the image (highest 
confidence = %.3f)' % result.max())
+        if USE_IMAGE_NOT_FOUND_EXCEPTION:
+            raise ImageNotFoundException('Could not locate the image (highest 
confidence = %.3f)' % result.max())
+        else:
+            return None
 
     # use a generator for API consistency:
     matchx = matches[1] * step + region[0]  # vectorized
@@ -246,7 +255,10 @@
         haystackFileObj.close()
 
     if numMatchesFound == 0:
-        raise ImageNotFoundException('Could not locate the image.')
+        if USE_IMAGE_NOT_FOUND_EXCEPTION:
+            raise ImageNotFoundException('Could not locate the image.')
+        else:
+            return None
 
 
 def locate(needleImage, haystackImage, **kwargs):
@@ -256,7 +268,10 @@
     if len(points) > 0:
         return points[0]
     else:
-        raise ImageNotFoundException('Could not locate the image.')
+        if USE_IMAGE_NOT_FOUND_EXCEPTION:
+            raise ImageNotFoundException('Could not locate the image.')
+        else:
+            return None
 
 
 def locateOnScreen(image, minSearchTime=0, **kwargs):
@@ -280,7 +295,10 @@
                 return retVal
         except ImageNotFoundException:
             if time.time() - start > minSearchTime:
-                raise
+                if USE_IMAGE_NOT_FOUND_EXCEPTION:
+                    raise
+                else:
+                    return None
 
 
 def locateAllOnScreen(image, **kwargs):


Reply via email to