File python3.patch of Package facedetect

From 8037d4406eb76dd5c106819f72c3562f8b255b5b Mon Sep 17 00:00:00 2001
From: Yuri D'Elia <wavexx@thregr.org>
Date: Wed, 5 Apr 2017 14:40:12 +0200
Subject: [PATCH] Prefer Python 3 over 2.7

---
 README.rst | 6 +++---
 facedetect | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README.rst b/README.rst
index b42ca32..f885896 100644
--- a/README.rst
+++ b/README.rst
@@ -132,13 +132,13 @@ Dependencies
 
 The following software is currently required for `facedetect`:
 
-- Python
-- Python OpenCV (``python-opencv``)
+- Python 3 or Python 2.7
+- Python OpenCV >= 2.4 (``python3-opencv`` or ``python-opencv``)
 - OpenCV data files (``opencv-data`` if available, or ``libopencv-dev``)
 
 On Debian/Ubuntu, you can install all the required dependencies with::
 
-  sudo apt-get install python python-opencv libopencv-dev
+  sudo apt-get install python3-opencv opencv-data
 
 and then install `facedetect` with::
 
diff --git a/facedetect b/facedetect
index 4b18a1a..f53d0b9 100755
--- a/facedetect
+++ b/facedetect
@@ -1,8 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # facedetect: a simple face detector for batch processing
 # Copyright(c) 2013-2016 by wave++ "Yuri D'Elia" <wavexx@thregr.org>
 # Distributed under GPLv2+ (see COPYING) WITHOUT ANY WARRANTY.
-from __future__ import print_function, division
+from __future__ import print_function, division, generators, unicode_literals
 
 import argparse
 import numpy as np
@@ -58,7 +58,7 @@ def fatal(msg):
 
 
 def load_cascades(data_dir):
-    for k, v in PROFILES.iteritems():
+    for k, v in PROFILES.items():
         v = os.path.join(data_dir, v)
         try:
             if not os.path.exists(v):
@@ -258,7 +258,7 @@ def __main__():
 
             if args.debug:
                 lines = []
-                for k, v in scores[i].iteritems():
+                for k, v in scores[i].items():
                     lines.append("{}: {}".format(k, v))
                 h = rect[1] + rect[3] + fontHeight
                 for line in lines:
-- 
GitLab

openSUSE Build Service is sponsored by