merge 3.20.16 in 3.21 3.21
authorDavid Douard <david.douard@logilab.fr>
Tue, 19 Jul 2016 16:13:12 +0200
branch3.21
changeset 11404 98eebbe3de23
parent 11371 2cc16363d6a3 (current diff)
parent 11403 b0dffe713b2b (diff)
child 11405 5ba55f4c813a
child 12837 d26dba971632
merge 3.20.16 in 3.21
.hgtags
__pkginfo__.py
cubicweb.spec
dataimport/__init__.py
dataimport/csv.py
debian/changelog
--- a/.hgtags	Tue Jun 21 07:42:30 2016 +0200
+++ b/.hgtags	Tue Jul 19 16:13:12 2016 +0200
@@ -545,3 +545,6 @@
 636a83e65870433c2560f3c49d55ca628bc96e11 3.20.15
 636a83e65870433c2560f3c49d55ca628bc96e11 debian/3.20.15-1
 636a83e65870433c2560f3c49d55ca628bc96e11 centos/3.20.15-1
+e60a8e5d29ef003eb78538a0d2ce083eebac7bfd 3.20.16
+e60a8e5d29ef003eb78538a0d2ce083eebac7bfd debian/3.20.16-1
+e60a8e5d29ef003eb78538a0d2ce083eebac7bfd centos/3.20.16-1
--- a/dataimport/csv.py	Tue Jun 21 07:42:30 2016 +0200
+++ b/dataimport/csv.py	Tue Jul 19 16:13:12 2016 +0200
@@ -32,6 +32,7 @@
     else:
         f = stream_or_filename
         f.seek(0)
+    i = 0  # useful is f is an empty file
     for i, line in enumerate(f):
         pass
     f.seek(0)
--- a/debian/changelog	Tue Jun 21 07:42:30 2016 +0200
+++ b/debian/changelog	Tue Jul 19 16:13:12 2016 +0200
@@ -46,6 +46,12 @@
 
  -- Julien Cristau <julien.cristau@logilab.fr>  Fri, 10 Jul 2015 17:04:11 +0200
 
+cubicweb (3.20.16-1) unstable; urgency=medium
+
+  * new upstream release 
+
+ -- David Douard <david.douard@logilab.fr>  Tue, 19 Jul 2016 12:48:45 +0200
+
 cubicweb (3.20.15-1) unstable; urgency=medium
 
   * new upstream release 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source.lintian-overrides	Tue Jul 19 16:13:12 2016 +0200
@@ -0,0 +1,1 @@
+cubicweb source: source-is-missing cubicweb/web/data/jquery.flot.js line length is * characters (>512)
--- a/web/captcha.py	Tue Jun 21 07:42:30 2016 +0200
+++ b/web/captcha.py	Tue Jul 19 16:13:12 2016 +0200
@@ -39,24 +39,24 @@
     adapted from http://code.activestate.com/recipes/440588/
     """
     # randomly select the foreground color
-    fgcolor = randint(0, 0xffff00)
-    # make the background color the opposite of fgcolor
-    bgcolor = fgcolor ^ 0xffffff
+    fgcolor = (randint(100, 256), randint(100, 256), randint(100, 256))
     # create a font object
     font = ImageFont.truetype(fontfile, fontsize)
     # determine dimensions of the text
     dim = font.getsize(text)
     # create a new image slightly larger that the text
-    img = Image.new('RGB', (dim[0]+5, dim[1]+5), bgcolor)
+    img = Image.new('RGB', (dim[0]+15, dim[1]+5), 0)
     draw = ImageDraw.Draw(img)
     # draw 100 random colored boxes on the background
     x, y = img.size
     for num in xrange(100):
+        fill = (randint(0, 100), randint(0, 100), randint(0, 100))
         draw.rectangle((randint(0, x), randint(0, y),
                         randint(0, x), randint(0, y)),
-                       fill=randint(0, 0xffffff))
+                       fill=fill)
     # add the text to the image
-    draw.text((3, 3), text, font=font, fill=fgcolor)
+    # we add a trailing space to prevent the last char to be truncated
+    draw.text((3, 3), text + ' ', font=font, fill=fgcolor)
     img = img.filter(ImageFilter.EDGE_ENHANCE_MORE)
     return img