Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 840459 Details for
Bug 1045894
add python3-python-django-simple-captcha subpackage
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
git commit adding python3 subpackage
0001-added-python3-subpackage.patch (text/plain), 10.09 KB, created by
Jakub Dorňák
on 2013-12-22 20:48:32 UTC
(
hide
)
Description:
git commit adding python3 subpackage
Filename:
MIME Type:
Creator:
Jakub Dorňák
Created:
2013-12-22 20:48:32 UTC
Size:
10.09 KB
patch
obsolete
>From ec74fe8fa128a6707987ba23eb684cecacce2f81 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Jakub=20Dor=C5=88=C3=A1k?= <jdornak@redhat.com> >Date: Sun, 22 Dec 2013 21:42:57 +0100 >Subject: [PATCH] added python3 subpackage > >--- > django-simple-captcha-0.3.3-python3.patch | 123 ++++++++++++++++++++++++ > django-simple-captcha-0.3.3-urls.defaults.patch | 18 ++++ > python-django-simple-captcha.spec | 65 ++++++++++++- > 3 files changed, 201 insertions(+), 5 deletions(-) > create mode 100644 django-simple-captcha-0.3.3-python3.patch > create mode 100644 django-simple-captcha-0.3.3-urls.defaults.patch > >diff --git a/django-simple-captcha-0.3.3-python3.patch b/django-simple-captcha-0.3.3-python3.patch >new file mode 100644 >index 0000000..87307cf >--- /dev/null >+++ b/django-simple-captcha-0.3.3-python3.patch >@@ -0,0 +1,123 @@ >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/fields.py django-simple-captcha-0.3.3/captcha/fields.py >+--- django-simple-captcha-0.3.3.orig/captcha/fields.py 2012-04-21 14:55:16.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/fields.py 2013-12-22 19:31:47.308354956 +0100 >+@@ -7,6 +7,12 @@ from django.forms.fields import CharFiel >+ from django.forms.widgets import TextInput, MultiWidget, HiddenInput >+ from django.utils.translation import ugettext_lazy as _ >+ >++try: >++ unicode >++except: >++ # unicode is not available in Py3 >++ unicode = str >++ >+ >+ class CaptchaTextInput(MultiWidget): >+ def __init__(self, attrs=None, **kwargs): >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/helpers.py django-simple-captcha-0.3.3/captcha/helpers.py >+--- django-simple-captcha-0.3.3.orig/captcha/helpers.py 2012-04-21 14:55:21.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/helpers.py 2013-12-22 19:28:56.168234941 +0100 >+@@ -2,6 +2,11 @@ >+ import random >+ from captcha.conf import settings >+ >++try: >++ unicode >++except: >++ # unicode is not available in Py3 >++ unicode = str >+ >+ def math_challenge(): >+ operators = ('+', '*', '-',) >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/management/commands/captcha_clean.py django-simple-captcha-0.3.3/captcha/management/commands/captcha_clean.py >+--- django-simple-captcha-0.3.3.orig/captcha/management/commands/captcha_clean.py 2012-04-21 14:54:25.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/management/commands/captcha_clean.py 2013-12-22 19:22:14.581108024 +0100 >+@@ -11,15 +11,15 @@ class Command(BaseCommand): >+ verbose = int(options.get('verbosity')) >+ expired_keys = CaptchaStore.objects.filter(expiration__lte=get_safe_now()).count() >+ if verbose >= 1: >+- print "Currently %d expired hashkeys" % expired_keys >++ print("Currently %d expired hashkeys" % expired_keys) >+ try: >+ CaptchaStore.remove_expired() >+ except: >+ if verbose >= 1: >+- print "Unable to delete expired hashkeys." >++ print("Unable to delete expired hashkeys.") >+ sys.exit(1) >+ if verbose >= 1: >+ if expired_keys > 0: >+- print "%d expired hashkeys removed." % expired_keys >++ print("%d expired hashkeys removed." % expired_keys) >+ else: >+- print "No keys to remove." >++ print("No keys to remove.") >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/models.py django-simple-captcha-0.3.3/captcha/models.py >+--- django-simple-captcha-0.3.3.orig/captcha/models.py 2012-04-21 14:52:08.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/models.py 2013-12-22 19:32:17.005369176 +0100 >+@@ -5,13 +5,19 @@ import random >+ import time >+ import unicodedata >+ >++try: >++ unicode >++except: >++ # unicode is not available in Py3 >++ unicode = str >++ >+ # Heavily based on session key generation in Django >+ # Use the system (hardware-based) random number generator if it exists. >+ if hasattr(random, 'SystemRandom'): >+ randrange = random.SystemRandom().randrange >+ else: >+ randrange = random.randrange >+-MAX_RANDOM_KEY = 18446744073709551616L # 2 << 63 >++MAX_RANDOM_KEY = 18446744073709551616 # 2 << 63 >+ >+ >+ try: >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/tests/__init__.py django-simple-captcha-0.3.3/captcha/tests/__init__.py >+--- django-simple-captcha-0.3.3.orig/captcha/tests/__init__.py 2012-04-21 15:14:51.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/tests/__init__.py 2013-12-22 19:32:53.095384026 +0100 >+@@ -7,6 +7,12 @@ from django.utils.translation import uge >+ from django.core.exceptions import ImproperlyConfigured >+ import datetime >+ >++try: >++ unicode >++except: >++ # unicode is not available in Py3 >++ unicode = str >++ >+ >+ class CaptchaCase(TestCase): >+ urls = 'captcha.tests.urls' >+@@ -137,7 +143,7 @@ class CaptchaCase(TestCase): >+ try: >+ self.client.get(reverse('captcha-test')) >+ self.fail() >+- except ImproperlyConfigured, e: >++ except ImproperlyConfigured as e: >+ self.failUnless('CAPTCHA_OUTPUT_FORMAT' in unicode(e)) >+ >+ def testPerFormFormat(self): >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/views.py django-simple-captcha-0.3.3/captcha/views.py >+--- django-simple-captcha-0.3.3.orig/captcha/views.py 2012-04-21 15:17:36.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/views.py 2013-12-22 19:22:14.581108024 +0100 >+@@ -1,12 +1,15 @@ >+ from captcha.conf import settings >+ from captcha.models import CaptchaStore >+-from cStringIO import StringIO >+ from django.http import HttpResponse, Http404 >+ from django.shortcuts import get_object_or_404 >+ import os >+ import random >+ import re >+ import tempfile >++try: >++ from cStringIO import StringIO >++except ImportError: >++ from io import BytesIO as StringIO >+ >+ try: >+ import Image >diff --git a/django-simple-captcha-0.3.3-urls.defaults.patch b/django-simple-captcha-0.3.3-urls.defaults.patch >new file mode 100644 >index 0000000..0b2deb7 >--- /dev/null >+++ b/django-simple-captcha-0.3.3-urls.defaults.patch >@@ -0,0 +1,18 @@ >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/tests/urls.py django-simple-captcha-0.3.3/captcha/tests/urls.py >+--- django-simple-captcha-0.3.3.orig/captcha/tests/urls.py 2012-04-04 17:02:46.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/tests/urls.py 2013-12-22 18:49:43.909304497 +0100 >+@@ -1,4 +1,4 @@ >+-from django.conf.urls.defaults import * >++from django.conf.urls import * >+ urlpatterns = patterns('', >+ url(r'test/$','captcha.tests.views.test',name='captcha-test'), >+ url(r'test2/$','captcha.tests.views.test_custom_error_message',name='captcha-test-custom-error-message'), >+diff -up --recursive django-simple-captcha-0.3.3.orig/captcha/urls.py django-simple-captcha-0.3.3/captcha/urls.py >+--- django-simple-captcha-0.3.3.orig/captcha/urls.py 2012-04-21 15:17:19.000000000 +0200 >++++ django-simple-captcha-0.3.3/captcha/urls.py 2013-12-22 18:49:25.446322827 +0100 >+@@ -1,4 +1,4 @@ >+-from django.conf.urls.defaults import patterns, url >++from django.conf.urls import patterns, url >+ >+ urlpatterns = patterns('captcha.views', >+ url(r'image/(?P<key>\w+)/$', 'captcha_image', name='captcha-image'), >diff --git a/python-django-simple-captcha.spec b/python-django-simple-captcha.spec >index 1a4caa8..fd15183 100644 >--- a/python-django-simple-captcha.spec >+++ b/python-django-simple-captcha.spec >@@ -1,20 +1,28 @@ >+%bcond_without python3 >+ > %global pkgname django-simple-captcha > %global obs_ver 0.3.0-2 > > Summary: Django application to add captcha images to any Django form > Name: python-django-simple-captcha > Version: 0.3.3 >-Release: 4%{?dist} >+Release: 5%{?dist} > License: MIT > Group: Development/Libraries > URL: https://github.com/mbi/django-simple-captcha > Source: http://pypi.python.org/packages/source/d/%{pkgname}/%{pkgname}-%{version}.tar.gz > #md5=28acf0980e49103ee4a1301382c33418 >+Patch0: django-simple-captcha-0.3.3-urls.defaults.patch >+Patch1: django-simple-captcha-0.3.3-python3.patch > BuildArch: noarch > >-BuildRequires: python2-devel >-BuildRequires: python-setuptools >+BuildRequires: python2-devel >+BuildRequires: python-setuptools > BuildRequires: gettext >+%if 0%{?with_python3} >+BuildRequires: python3-devel >+BuildRequires: python3-setuptools >+%endif > > Requires: python-django > Requires: python-imaging >@@ -25,29 +33,76 @@ Obsoletes: %{pkgname} < %{obs_ver} > > > %description >-Django Simple Captcha is an extremely simple, yet highly customizable >+Django Simple Captcha is an extremely simple, yet highly customizable >+Django application to add captcha images to any Django form >+ >+ >+%if 0%{?with_python3} >+%package -n python3-%{pkgname} >+Summary: Django application to add captcha images to any Django form >+Group: Development/Libraries >+ >+Requires: python-django >+Requires: python-imaging >+Requires: flite >+ >+%description -n python3-%{pkgname} >+Django Simple Captcha is an extremely simple, yet highly customizable > Django application to add captcha images to any Django form >+%endif >+ > > %prep > %setup -q -n %{pkgname}-%{version} >+%patch0 -p1 -b .urls.defaults >+%patch1 -p1 -b .python3 > > # prevent pre-build egg-info in final package > rm -rf django_simple_captcha.egg-info > >+%if 0%{?with_python3} >+cp -a . %{py3dir} >+%endif >+ >+ > %build > %{__python} setup.py build > >+%if 0%{?with_python3} >+pushd %{py3dir} >+%{__python3} setup.py build >+popd >+%endif >+ >+ > %install > %{__python} setup.py install -O1 --skip-build --root="%{buildroot}" --prefix="%{_prefix}" > >+%if 0%{?with_python3} >+pushd %{py3dir} >+%{__python3} setup.py install -O1 --skip-build --root="%{buildroot}" --prefix="%{_prefix}" >+popd >+%endif > > >-%files >+%files > %doc LICENSE MANIFEST.in PKG-INFO > %{python_sitelib}/captcha/ > %{python_sitelib}/django_simple_captcha-%{version}-py2* > >+ >+%if 0%{?with_python3} >+%files -n python3-%{pkgname} >+%doc LICENSE MANIFEST.in PKG-INFO >+%{python3_sitelib}/captcha/ >+%{python3_sitelib}/django_simple_captcha-%{version}-py3* >+%endif >+ >+ > %changelog >+* Sun Dec 22 2013 Jakub DorÅák <jdornak@redhat.com> - 0.3.3-5 >+- added python3 subpackage >+ > * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-4 > - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild > >-- >1.8.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1045894
: 840459