Skip to content

Commit e486ba3

Browse files
committed
Ensure strings are handled the same in Py2 & 3
1 parent 5572910 commit e486ba3

16 files changed

+74
-10
lines changed

podgen/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
:copyright: 2016, Thorben Dahl <[email protected]>
1111
:license: FreeBSD and LGPL, see license.* for more details.
1212
"""
13+
# Support for Python 2.7
14+
from __future__ import absolute_import, division, print_function, unicode_literals
15+
from builtins import *
16+
1317
from .podcast import Podcast
1418
from .episode import Episode
1519
from .media import Media

podgen/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
88
:license: FreeBSD and LGPL, see license.* for more details.
99
'''
10+
# Support for Python 2.7
11+
from __future__ import absolute_import, division, print_function, unicode_literals
12+
from builtins import *
1013

1114
import sys
1215
import datetime

podgen/category.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
:copyright: 2016, Thorben Dahl <[email protected]>
99
:license: FreeBSD and LGPL, see license.* for more details.
1010
"""
11+
# Support for Python 2.7
12+
from __future__ import absolute_import, division, print_function, unicode_literals
13+
from builtins import *
14+
15+
1116
class Category(object):
1217
"""Immutable class representing an iTunes category.
1318

podgen/episode.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
99
:license: FreeBSD and LGPL, see license.* for more details.
1010
"""
11+
# Support for Python 2.7
12+
from __future__ import absolute_import, division, print_function, unicode_literals
13+
from builtins import *
14+
from future.utils import iteritems
15+
1116
import warnings
1217

1318
from lxml import etree
@@ -18,8 +23,6 @@
1823
from podgen.not_supported_by_itunes_warning import NotSupportedByItunesWarning
1924
from podgen.util import formatRFC2822, listToHumanreadableStr
2025
from podgen.compat import string_types
21-
from builtins import str
22-
from future.utils import iteritems
2326

2427

2528
class Episode(object):
@@ -503,14 +506,14 @@ def image(self, image):
503506
def explicit(self):
504507
"""Whether this podcast episode contains material which may be
505508
inappropriate for children.
506-
509+
507510
The value of the podcast's explicit attribute is used by default, if
508511
this is kept as ``None``.
509512
510513
If you set this to ``True``, an "explicit" parental advisory
511-
graphic will appear in the Name column in iTunes. If the value is
512-
``False``, the parental advisory type is considered Clean, meaning that
513-
no explicit language or adult content is included anywhere in this
514+
graphic will appear in the Name column in iTunes. If the value is
515+
``False``, the parental advisory type is considered Clean, meaning that
516+
no explicit language or adult content is included anywhere in this
514517
episode, and a "clean" graphic will appear.
515518
516519
:type: :obj:`bool`

podgen/media.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99
:copyright: 2016, Thorben Dahl <[email protected]>
1010
:license: FreeBSD and LGPL, see license.* for more details.
1111
"""
12+
# Support for Python 2.7
13+
from __future__ import absolute_import, division, print_function, unicode_literals
14+
from builtins import *
15+
from future.moves.urllib.parse import urlparse
16+
from future.utils import raise_from
17+
1218
import os
1319
import tempfile
1420
import warnings
15-
from future.moves.urllib.parse import urlparse
16-
from future.utils import raise_from
1721
import datetime
1822

1923
from tinytag import TinyTag

podgen/not_supported_by_itunes_warning.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
:copyright: 2016, Thorben Dahl <[email protected]>
1010
:license: FreeBSD and LGPL, see license.* for more details.
1111
"""
12+
# Support for Python 2.7
13+
from __future__ import absolute_import, division, print_function, unicode_literals
14+
from builtins import *
15+
16+
1217
class NotSupportedByItunesWarning(UserWarning):
1318
pass

podgen/person.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
:copyright: 2016, Thorben Dahl <[email protected]>
1010
:license: FreeBSD and LGPL, see license.* for more details.
1111
"""
12+
# Support for Python 2.7
13+
from __future__ import absolute_import, division, print_function, unicode_literals
14+
from builtins import *
15+
16+
1217
class Person(object):
1318
"""Data-oriented class representing a single person or entity.
1419

podgen/podcast.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
:license: FreeBSD and LGPL, see license.* for more details.
1010
1111
"""
12+
# Support for Python 2.7
13+
from __future__ import absolute_import, division, print_function, unicode_literals
14+
from builtins import *
1215
from future.utils import iteritems
16+
1317
from lxml import etree
1418
from datetime import datetime
1519
import dateutil.parser

podgen/tests/test_category.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
:copyright: 2016, Thorben Dahl <[email protected]>
99
:license: FreeBSD and LGPL, see license.* for more details.
1010
"""
11+
# Support for Python 2.7
12+
from __future__ import absolute_import, division, print_function, unicode_literals
13+
from builtins import *
14+
1115
import unittest
1216

1317
from podgen import Category

podgen/tests/test_episode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
:copyright: 2016, Thorben Dahl <[email protected]>
99
:license: FreeBSD and LGPL, see license.* for more details.
1010
"""
11+
# Support for Python 2.7
12+
from __future__ import absolute_import, division, print_function, unicode_literals
13+
from builtins import *
1114

1215
import unittest
1316
import warnings
@@ -20,6 +23,7 @@
2023
import pytz
2124
from dateutil.parser import parse as parsedate
2225

26+
2327
class TestBaseEpisode(unittest.TestCase):
2428

2529
def setUp(self):

0 commit comments

Comments
 (0)