Andreas Tille pushed to branch master at Debian Med / python-pauvre


Commits:
8fb613d0 by Andreas Tille at 2020-04-24T13:07:36+02:00
Port remaining Python2 script

- - - - -


2 changed files:

- + debian/patches/2to3.patch
- + debian/patches/series


Changes:

=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,92 @@
+Author: Andreas Tille <[email protected]>
+Last-Update: Fri, 24 Apr 2020 12:49:17 +0200
+Description: Test script somehow remained at Python2 -> fix this using 2to3
+
+--- a/pauvre/lsi/test.py
++++ b/pauvre/lsi/test.py
+@@ -3,10 +3,10 @@
+ # Email: [email protected]
+ # Date: 09/02/2013
+ 
+-from lsi import intersection
++from .lsi import intersection
+ import random
+ import time, sys
+-from helper import *
++from .helper import *
+ 
+ ev = 0.00000001
+ 
+@@ -42,20 +42,20 @@ es = False
+ now = time.time()
+ for seg1 in S:
+       if approx_equal(seg1[0][0], seg1[1][0], ev):
+-              print 'VERTICAL SEG'
+-              print ''
+-              print ''
++              print('VERTICAL SEG')
++              print('')
++              print('')
+               vs = True
+       if approx_equal(seg1[0][1], seg1[1][1], ev):
+-              print 'HORIZONTAL SEG'
+-              print ''
+-              print ''
++              print('HORIZONTAL SEG')
++              print('')
++              print('')
+               hs = True
+       for seg2 in S:
+               if seg1 is not seg2 and segs_equal(seg1, seg2):
+-                      print 'EQUAL SEGS'
+-                      print ''
+-                      print ''
++                      print('EQUAL SEGS')
++                      print('')
++                      print('')
+                       es = True
+               if seg1 is not seg2 and (seg2, seg1) not in seen:
+                       i = intersect(seg1, seg2)
+@@ -68,17 +68,17 @@ for seg1 in S:
+                               seen.append((seg1, seg2))
+ later = time.time()
+ n2time = later-now
+-print "Line sweep results:"
++print("Line sweep results:")
+ now = time.time()
+ lsinters = intersection(S)
+ inters = []
+-for k, v in lsinters.iteritems():
++for k, v in lsinters.items():
+       #print '{0}: {1}'.format(k, v)
+       inters.append(k)
+ #     inters.append(v)
+ later = time.time()
+-print 'TIME ELAPSED: {0}'.format(later-now)
+-print "N^2 comparison results:"
++print('TIME ELAPSED: {0}'.format(later-now))
++print("N^2 comparison results:")
+ pts_seen = []
+ highestseen = 0
+ for i in intersections:
+@@ -97,14 +97,14 @@ for i in intersections:
+               if approx_equal(k[0], i[0][0], ev) and approx_equal(k[1], 
i[0][1], ev):
+                       in_k = True
+       if in_k == False:
+-              print 'Not in K: {0}: {1}'.format(i[0], i[1])
++              print('Not in K: {0}: {1}'.format(i[0], i[1]))
+ #     print i
+-print highestseen
+-print 'TIME ELAPSED: {0}'.format(n2time)
++print(highestseen)
++print('TIME ELAPSED: {0}'.format(n2time))
+ #print 'Missing from line sweep but in N^2:'
+ #for i in seen:
+ #     matched = False
+-print len(lsinters)
+-print len(pts_seen)
++print(len(lsinters))
++print(len(pts_seen))
+ if len(lsinters) != len(pts_seen):
+-      print 'uh oh!'
++      print('uh oh!')


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+2to3.patch



View it on GitLab: 
https://salsa.debian.org/med-team/python-pauvre/-/commit/8fb613d05742d27cfc95a74abf99389ba7024a1e

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/python-pauvre/-/commit/8fb613d05742d27cfc95a74abf99389ba7024a1e
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to