Skip to content

Commit

Permalink
Add upstream commit 723c40a8153d20dce0c6dd1a91f193ef0375a194 via patch:
Browse files Browse the repository at this point in the history
    Update ext.appengine.fields for unicode_literals. Fixes #153.

Fixes build failure with on py32.  Bump PKGREVISION.
  • Loading branch information
kleink committed Sep 23, 2013
1 parent 86196f7 commit 8ddd3d0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
4 changes: 2 additions & 2 deletions www/py-wtforms/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.5 2013/05/08 08:30:47 kleink Exp $
# $NetBSD: Makefile,v 1.6 2013/09/23 20:36:27 kleink Exp $

DISTNAME= WTForms-1.0.4
PKGNAME= ${PYPKGPREFIX}-${DISTNAME:tl}
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= www python
MASTER_SITES= http://pypi.python.org/packages/source/W/WTForms/
EXTRACT_SUFX= .zip
Expand Down
3 changes: 2 additions & 1 deletion www/py-wtforms/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.3 2013/05/07 20:49:33 kleink Exp $
$NetBSD: distinfo,v 1.4 2013/09/23 20:36:27 kleink Exp $

SHA1 (WTForms-1.0.4.zip) = e8d97b4c72e805b8e29c5d2e6673c40780490c69
RMD160 (WTForms-1.0.4.zip) = 93e853ff39c356bf73c01d37b4a38541d2e3e4fb
Size (WTForms-1.0.4.zip) = 345261 bytes
SHA1 (patch-ext_appengine_fields.py) = 3f4eef6d763522a93cabc60aeb5691f359297fad
51 changes: 51 additions & 0 deletions www/py-wtforms/patches/patch-ext_appengine_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
$NetBSD: patch-ext_appengine_fields.py,v 1.1 2013/09/23 20:36:27 kleink Exp $

--- wtforms/ext/appengine/fields.py.orig 2013-05-03 10:40:00.000000000 +0200
+++ wtforms/ext/appengine/fields.py 2013-09-23 22:26:20.000000000 +0200
@@ -114,7 +114,7 @@
def __init__(self, label=None, validators=None, reference_class=None,
label_attr=None, get_label=None, allow_blank=False,
- blank_text=u'', **kwargs):
+ blank_text='', **kwargs):
super(KeyPropertyField, self).__init__(label, validators,
**kwargs)
if label_attr is not None:
@@ -149,7 +149,7 @@
def iter_choices(self):
if self.allow_blank:
- yield (u'__None', self.blank_text, self.data is None)
+ yield ('__None', self.blank_text, self.data is None)

for obj in self.query:
key = str(obj.key.id())
@@ -170,9 +170,9 @@
if self.data.key == obj.key:
break
else:
- raise ValueError(self.gettext(u'Not a valid choice'))
+ raise ValueError(self.gettext('Not a valid choice'))
elif not self.allow_blank:
- raise ValueError(self.gettext(u'Not a valid choice'))
+ raise ValueError(self.gettext('Not a valid choice'))


class StringListPropertyField(fields.TextAreaField):
@@ -203,14 +203,14 @@
if self.raw_data:
return self.raw_data[0]
else:
- return self.data and unicode("\n".join(self.data)) or u''
+ return text_type('\n'.join(self.data)) if self.data else ''

def process_formdata(self, valuelist):
if valuelist:
try:
self.data = [int(value) for value in valuelist[0].splitlines()]
except ValueError:
- raise ValueError(self.gettext(u'Not a valid integer list'))
+ raise ValueError(self.gettext('Not a valid integer list'))


class GeoPtPropertyField(fields.TextField):

0 comments on commit 8ddd3d0

Please sign in to comment.