summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hanna2015-07-15 15:39:26 +0200
committerSimon Hanna2015-07-15 15:39:26 +0200
commitfa0d42c98a02b7834cec8563cf017baa57812b43 (patch)
treec890986e2f2d930a5ec94f40ef455962967fc71e
downloadaur-fa0d42c98a02b7834cec8563cf017baa57812b43.tar.gz
initial commit
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD42
-rw-r--r--tests.patch67
-rw-r--r--views.patch45
4 files changed, 180 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..391b3f263cb9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = python-django-ical
+ pkgdesc = a simple library/framework for creating ical feeds based in Django's syndication feed framework
+ pkgver = 1.3
+ pkgrel = 1
+ url = https://bitbucket.org/IanLewis/django-ical
+ arch = any
+ license = MIT
+ makedepends = python
+ makedepends = python-setuptools
+ makedepends = python2
+ makedepends = python2-setuptools
+ source = https://pypi.python.org/packages/source/d/django-ical/django-ical-1.3.tar.gz
+ source = tests.patch
+ source = views.patch
+ sha256sums = 9a002aa3dcb3c7a4fc1c6c81bae8906bb89e78b429f43108ff82f76080386740
+ sha256sums = c6dd20758035581e829233000dd5263e2062fa8c1e43d98169412bbec92fc067
+ sha256sums = a043092bcf3ec90fc8af8ad36865614c38636d5ebf36deb6ee3e4ddb91691134
+
+pkgname = python-django-ical
+ depends = python-django>=1.4.2
+ depends = python-icalendar
+
+pkgname = python2-django-ical
+ depends = python2-django
+ depends = python2-icalendar
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ba0bf9868542
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Simon Hanna <simon DOT hanna at serve-me dot info>
+pkgname=('python-django-ical' 'python2-django-ical')
+pkgver=1.3
+pkgrel=1
+pkgdesc="a simple library/framework for creating ical feeds based in Django's syndication feed framework"
+arch=('any')
+url="https://bitbucket.org/IanLewis/django-ical"
+license=('MIT')
+makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools')
+source=("https://pypi.python.org/packages/source/d/django-ical/django-ical-${pkgver}.tar.gz"
+ 'tests.patch' 'views.patch'
+)
+sha256sums=('9a002aa3dcb3c7a4fc1c6c81bae8906bb89e78b429f43108ff82f76080386740'
+ 'c6dd20758035581e829233000dd5263e2062fa8c1e43d98169412bbec92fc067'
+ 'a043092bcf3ec90fc8af8ad36865614c38636d5ebf36deb6ee3e4ddb91691134')
+build() {
+ cp -r ${srcdir}/django-ical-${pkgver} ${srcdir}/django-ical-${pkgver}-py2
+
+ cd ${srcdir}/django-ical-${pkgver}
+ cd django_ical
+ patch < ${srcdir}/views.patch
+ patch < ${srcdir}/tests.patch
+ cd ..
+ python setup.py build
+
+ cd ${srcdir}/django-ical-${pkgver}-py2
+ python2 setup.py build
+}
+
+package_python-django-ical() {
+ depends=('python-django>=1.4.2' 'python-icalendar')
+ cd ${srcdir}/django-ical-${pkgver}
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ python setup.py install --prefix=/usr --root=${pkgdir}
+}
+
+package_python2-django-ical() {
+ depends=('python2-django' 'python2-icalendar')
+ cd ${srcdir}/django-ical-${pkgver}-py2
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ python2 setup.py install --prefix=/usr --root=${pkgdir}
+}
diff --git a/tests.patch b/tests.patch
new file mode 100644
index 000000000000..b71151c4e05e
--- /dev/null
+++ b/tests.patch
@@ -0,0 +1,67 @@
+--- django_ical/tests.py.old 2015-07-15 15:06:29.532564747 +0200
++++ django_ical/tests.py 2015-07-15 15:06:42.705891733 +0200
+@@ -6,6 +6,7 @@
+
+ from django.test import TestCase
+ from django.test.client import RequestFactory
++from six import b
+
+ from django_ical.feedgenerator import ICal20Feed
+ from django_ical.views import ICalFeed
+@@ -69,7 +70,7 @@
+ if organizer_dic:
+ if isinstance(organizer_dic, dict):
+ organizer = icalendar.vCalAddress('MAILTO:%s' % organizer_dic['email'])
+- for key, val in organizer_dic.iteritems():
++ for key, val in organizer_dic.items():
+ if key is not 'email':
+ organizer.params[key] = icalendar.vText(val)
+ else:
+@@ -119,20 +120,20 @@
+ self.assertEquals(calendar.subcomponents[0]['SUMMARY'], 'Title1')
+ self.assertEquals(calendar.subcomponents[0]['DESCRIPTION'], 'Description1')
+ self.assertTrue(calendar.subcomponents[0]['URL'].endswith('/event/1'))
+- self.assertEquals(calendar.subcomponents[0]['DTSTART'].to_ical(), '20120501T180000')
+- self.assertEquals(calendar.subcomponents[0]['DTEND'].to_ical(), '20120501T200000')
++ self.assertEquals(calendar.subcomponents[0]['DTSTART'].to_ical(), b('20120501T180000'))
++ self.assertEquals(calendar.subcomponents[0]['DTEND'].to_ical(), b('20120501T200000'))
+ self.assertEquals(calendar.subcomponents[0]['GEO'].to_ical(), "37.386013;-122.082932")
+ self.assertEquals(calendar.subcomponents[0]['ORGANIZER'].to_ical(),
+- "MAILTO:john.doe@example.com")
++ b("MAILTO:john.doe@example.com"))
+
+ self.assertEquals(calendar.subcomponents[1]['SUMMARY'], 'Title2')
+ self.assertEquals(calendar.subcomponents[1]['DESCRIPTION'], 'Description2')
+ self.assertTrue(calendar.subcomponents[1]['URL'].endswith('/event/2'))
+- self.assertEquals(calendar.subcomponents[1]['DTSTART'].to_ical(), '20120506T180000')
+- self.assertEquals(calendar.subcomponents[1]['DTEND'].to_ical(), '20120506T200000')
++ self.assertEquals(calendar.subcomponents[1]['DTSTART'].to_ical(), b('20120506T180000'))
++ self.assertEquals(calendar.subcomponents[1]['DTEND'].to_ical(), b('20120506T200000'))
+ self.assertEquals(calendar.subcomponents[1]['GEO'].to_ical(), "37.386013;-122.082932")
+ self.assertEquals(calendar.subcomponents[0]['ORGANIZER'].to_ical(),
+- "MAILTO:john.doe@example.com")
++ b("MAILTO:john.doe@example.com"))
+
+ def test_wr_timezone(self):
+ """
+@@ -176,16 +177,16 @@
+ calendar = icalendar.Calendar.from_ical(response.content)
+ self.assertEquals(len(calendar.subcomponents), 2)
+
+- self.assertEquals(calendar.subcomponents[0]['DTSTART'].to_ical(), '20120501T180000')
++ self.assertEquals(calendar.subcomponents[0]['DTSTART'].to_ical(), b('20120501T180000'))
+ self.assertEquals(calendar.subcomponents[0]['DTSTART'].params['TZID'], 'Asia/Tokyo')
+
+- self.assertEquals(calendar.subcomponents[0]['DTEND'].to_ical(), '20120501T200000')
++ self.assertEquals(calendar.subcomponents[0]['DTEND'].to_ical(), b('20120501T200000'))
+ self.assertEquals(calendar.subcomponents[0]['DTEND'].params['TZID'], 'Asia/Tokyo')
+
+- self.assertEquals(calendar.subcomponents[1]['DTSTART'].to_ical(), '20120506T180000')
++ self.assertEquals(calendar.subcomponents[1]['DTSTART'].to_ical(), b('20120506T180000'))
+ self.assertEquals(calendar.subcomponents[1]['DTSTART'].params['TZID'], 'US/Eastern')
+
+- self.assertEquals(calendar.subcomponents[1]['DTEND'].to_ical(), '20120506T200000')
++ self.assertEquals(calendar.subcomponents[1]['DTEND'].to_ical(), b('20120506T200000'))
+ self.assertEquals(calendar.subcomponents[1]['DTEND'].params['TZID'], 'US/Eastern')
+
+ def test_file_name(self):
diff --git a/views.patch b/views.patch
new file mode 100644
index 000000000000..6b973dc0890a
--- /dev/null
+++ b/views.patch
@@ -0,0 +1,45 @@
+--- django_ical/views.py.old 2015-07-15 15:06:34.969228732 +0200
++++ django_ical/views.py 2015-07-15 15:06:42.705891733 +0200
+@@ -11,6 +11,10 @@
+ from django.core.exceptions import ObjectDoesNotExist
+ from django.contrib.syndication.views import Feed
+ from django.utils.http import http_date
++try:
++ from django.utils import six
++except ImportError:
++ import six
+
+ from django_ical import feedgenerator
+
+@@ -94,22 +98,21 @@
+
+ def _get_dynamic_attr(self, attname, obj, default=None):
+ """
+- Copied from django.contrib.syndication.views.Feed
++ Copied from django.contrib.syndication.views.Feed (v1.7.1)
+ """
+ try:
+ attr = getattr(self, attname)
+ except AttributeError:
+ return default
+ if callable(attr):
+- # Check func_code.co_argcount rather than try/excepting the
+- # function and catching the TypeError, because something inside
+- # the function may raise the TypeError. This technique is more
+- # accurate.
+- if hasattr(attr, 'func_code'):
+- argcount = attr.func_code.co_argcount
+- else:
+- argcount = attr.__call__.func_code.co_argcount
+- if argcount == 2: # one argument is 'self'
++ # Check co_argcount rather than try/excepting the function and
++ # catching the TypeError, because something inside the function
++ # may raise the TypeError. This technique is more accurate.
++ try:
++ code = six.get_function_code(attr)
++ except AttributeError:
++ code = six.get_function_code(attr.__call__)
++ if code.co_argcount == 2: # one argument is 'self'
+ return attr(obj)
+ else:
+ return attr()