From 9026316391b8edb6a5ccb07a72ad39808751b35f Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 4 Mar 2018 20:05:29 +0100 Subject: [PATCH] Use isort to sort import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …so that they all have the same structure. --- feedgen/__main__.py | 3 ++- feedgen/compat.py | 1 + feedgen/entry.py | 6 ++++-- feedgen/ext/dc.py | 1 + feedgen/ext/media.py | 3 ++- feedgen/ext/podcast.py | 3 ++- feedgen/ext/podcast_entry.py | 1 + feedgen/ext/syndication.py | 1 + feedgen/ext/torrent.py | 3 ++- feedgen/feed.py | 11 ++++++----- setup.py | 1 + tests/test_entry.py | 1 + tests/test_extension.py | 4 +++- tests/test_feed.py | 4 +++- tests/test_main.py | 1 + 15 files changed, 31 insertions(+), 13 deletions(-) diff --git a/feedgen/__main__.py b/feedgen/__main__.py index 2cf1346..abc0737 100644 --- a/feedgen/__main__.py +++ b/feedgen/__main__.py @@ -8,9 +8,10 @@ :license: FreeBSD and LGPL, see license.* for more details. ''' -from feedgen.feed import FeedGenerator import sys +from feedgen.feed import FeedGenerator + USAGE = ''' Usage: python -m feedgen [OPTION] diff --git a/feedgen/compat.py b/feedgen/compat.py index 80b6cd6..e9044b0 100644 --- a/feedgen/compat.py +++ b/feedgen/compat.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import sys + if sys.version_info[0] >= 3: string_types = str else: diff --git a/feedgen/entry.py b/feedgen/entry.py index d773e17..f65dafa 100644 --- a/feedgen/entry.py +++ b/feedgen/entry.py @@ -8,12 +8,14 @@ :license: FreeBSD and LGPL, see license.* for more details. ''' -from lxml import etree from datetime import datetime + import dateutil.parser import dateutil.tz -from feedgen.util import ensure_format, formatRFC2822 +from lxml import etree + from feedgen.compat import string_types +from feedgen.util import ensure_format, formatRFC2822 class FeedEntry(object): diff --git a/feedgen/ext/dc.py b/feedgen/ext/dc.py index 184a29f..21a5244 100644 --- a/feedgen/ext/dc.py +++ b/feedgen/ext/dc.py @@ -14,6 +14,7 @@ ''' from lxml import etree + from feedgen.ext.base import BaseExtension diff --git a/feedgen/ext/media.py b/feedgen/ext/media.py index 0bd5845..25d561a 100644 --- a/feedgen/ext/media.py +++ b/feedgen/ext/media.py @@ -11,8 +11,9 @@ ''' from lxml import etree + +from feedgen.ext.base import BaseEntryExtension, BaseExtension from feedgen.util import ensure_format -from feedgen.ext.base import BaseExtension, BaseEntryExtension MEDIA_NS = 'http://search.yahoo.com/mrss/' diff --git a/feedgen/ext/podcast.py b/feedgen/ext/podcast.py index e2bb3e5..a8af118 100644 --- a/feedgen/ext/podcast.py +++ b/feedgen/ext/podcast.py @@ -11,9 +11,10 @@ ''' from lxml import etree + +from feedgen.compat import string_types from feedgen.ext.base import BaseExtension from feedgen.util import ensure_format -from feedgen.compat import string_types class PodcastExtension(BaseExtension): diff --git a/feedgen/ext/podcast_entry.py b/feedgen/ext/podcast_entry.py index 3f3a7d9..4fa6128 100644 --- a/feedgen/ext/podcast_entry.py +++ b/feedgen/ext/podcast_entry.py @@ -11,6 +11,7 @@ ''' from lxml import etree + from feedgen.ext.base import BaseEntryExtension diff --git a/feedgen/ext/syndication.py b/feedgen/ext/syndication.py index 3b17e0c..0141369 100644 --- a/feedgen/ext/syndication.py +++ b/feedgen/ext/syndication.py @@ -11,6 +11,7 @@ http://web.resource.org/rss/1.0/modules/syndication/ ''' from lxml import etree + from feedgen.ext.base import BaseExtension SYNDICATION_NS = 'http://purl.org/rss/1.0/modules/syndication/' diff --git a/feedgen/ext/torrent.py b/feedgen/ext/torrent.py index a2eb49c..6f8b5f3 100644 --- a/feedgen/ext/torrent.py +++ b/feedgen/ext/torrent.py @@ -11,7 +11,8 @@ ''' from lxml import etree -from feedgen.ext.base import BaseExtension, BaseEntryExtension + +from feedgen.ext.base import BaseEntryExtension, BaseExtension TORRENT_NS = 'http://xmlns.ezrss.it/0.1/dtd/' diff --git a/feedgen/feed.py b/feedgen/feed.py index 6bf55d9..5539fb7 100644 --- a/feedgen/feed.py +++ b/feedgen/feed.py @@ -9,16 +9,17 @@ ''' -from lxml import etree +import sys from datetime import datetime + import dateutil.parser import dateutil.tz +from lxml import etree + +import feedgen.version +from feedgen.compat import string_types from feedgen.entry import FeedEntry from feedgen.util import ensure_format, formatRFC2822 -import feedgen.version -import sys -from feedgen.compat import string_types - _feedgen_version = feedgen.version.version_str diff --git a/setup.py b/setup.py index 2bfafc2..1549284 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- from setuptools import setup + import feedgen.version packages = ['feedgen', 'feedgen/ext'] diff --git a/tests/test_entry.py b/tests/test_entry.py index bb2d699..173eabf 100644 --- a/tests/test_entry.py +++ b/tests/test_entry.py @@ -7,6 +7,7 @@ These are test cases for a basic entry. """ import unittest + from feedgen.feed import FeedGenerator diff --git a/tests/test_extension.py b/tests/test_extension.py index bc4d335..59ef349 100644 --- a/tests/test_extension.py +++ b/tests/test_extension.py @@ -5,9 +5,11 @@ Tests for extensions """ import unittest -from feedgen.feed import FeedGenerator + from lxml import etree +from feedgen.feed import FeedGenerator + class TestExtensionSyndication(unittest.TestCase): diff --git a/tests/test_feed.py b/tests/test_feed.py index ffd8e4b..fcdbd4a 100644 --- a/tests/test_feed.py +++ b/tests/test_feed.py @@ -10,9 +10,11 @@ A basic feed does not contain entries so far. import os import tempfile import unittest + from lxml import etree + +from feedgen.ext.dc import DcEntryExtension, DcExtension from feedgen.feed import FeedGenerator -from feedgen.ext.dc import DcExtension, DcEntryExtension class TestSequenceFunctions(unittest.TestCase): diff --git a/tests/test_main.py b/tests/test_main.py index a6c6b88..7985289 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -8,6 +8,7 @@ import os import sys import tempfile import unittest + from feedgen import __main__