Skip to content

Commit

Permalink
Fixed GeoRSS Extemsion
Browse files Browse the repository at this point in the history
This patch fixes a few issues with pzll request lkiesow#66 which adds supprt
for a simple GeoRSS extension.
  • Loading branch information
lkiesow committed Mar 4, 2018
1 parent 2d9e85d commit 27e9cd0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion feedgen/ext/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

from feedgen.ext.base import BaseExtension


class GeoExtension(BaseExtension):
'''FeedGenerator extension for Simple GeoRSS.
'''

def extend_ns(self):
return { 'georss' : 'http://www.georss.org/georss' }
return {'georss': 'http://www.georss.org/georss'}
3 changes: 2 additions & 1 deletion feedgen/ext/geo_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from lxml import etree
from feedgen.ext.base import BaseEntryExtension


class GeoEntryExtension(BaseEntryExtension):
'''FeedEntry extension for Simple GeoRSS.
'''
Expand Down Expand Up @@ -45,7 +46,7 @@ def point(self, point=None):
'''Get or set the georss:point of the entry.
:param point: The GeoRSS formatted point (i.e. "42.36 -71.05")
:returns: The author of the podcast.
:returns: The current georss:point of the entry.
'''

if point is not None:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def test_podcastEntryItems(self):
namespaces=ns)
assert author == ['Lars Kiesow']


class TestExtensionGeo(unittest.TestCase):

def setUp(self):
Expand All @@ -156,7 +157,7 @@ def test_geoEntryItems(self):
ns = {'georss': 'http://www.georss.org/georss'}
root = etree.fromstring(self.fg.rss_str())
point = root.xpath('/rss/channel/item/georss:point/text()',
namespaces=ns)
namespaces=ns)
assert point == ['42.36 -71.05']


Expand Down

0 comments on commit 27e9cd0

Please sign in to comment.