本文整理汇总了Python中feedgen.feed.FeedGenerator.rights方法的典型用法代码示例。如果您正苦于以下问题:Python FeedGenerator.rights方法的具体用法?Python FeedGenerator.rights怎么用?Python FeedGenerator.rights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feedgen.feed.FeedGenerator
的用法示例。
在下文中一共展示了FeedGenerator.rights方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_generator
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import rights [as 别名]
def create_generator(self):
""" Setup and return a feedgen generator object """
fg = FeedGenerator()
fg.title(self.title)
fg.id(self.root_url)
fg.link(href=self.root_url, rel='alternate')
fg.language(u'en')
fg.description(self.description)
fg.rights(u"Copyright Contrivers' Review {}".format(datetime.datetime.now().year))
return fg
示例2: print_enc
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import rights [as 别名]
print_enc ('')
exit()
arg = sys.argv[1]
fg = FeedGenerator()
fg.id('http://lernfunk.de/_MEDIAID_123')
fg.title('Testfeed')
fg.author( {'name':'Lars Kiesow','email':'[email protected]'} )
fg.link( href='http://example.com', rel='alternate' )
fg.category(term='test')
fg.contributor( name='Lars Kiesow', email='[email protected]' )
fg.contributor( name='John Doe', email='[email protected]' )
fg.icon('http://ex.com/icon.jpg')
fg.logo('http://ex.com/logo.jpg')
fg.rights('cc-by')
fg.subtitle('This is a cool feed!')
fg.link( href='http://larskiesow.de/test.atom', rel='self' )
fg.language('de')
fe = fg.add_entry()
fe.id('http://lernfunk.de/_MEDIAID_123#1')
fe.title('First Element')
fe.content('''Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tamen
aberramus a proposito, et, ne longius, prorsus, inquam, Piso, si ista
mala sunt, placet. Aut etiam, ut vestitum, sic sententiam habeas aliam
domesticam, aliam forensem, ut in fronte ostentatio sit, intus veritas
occultetur? Cum id fugiunt, re eadem defendunt, quae Peripatetici,
verba.''')
fe.summary('Lorem ipsum dolor sit amet, consectetur adipiscing elit...')
fe.link( href='http://example.com', rel='alternate' )
fe.author( name='Lars Kiesow', email='[email protected]' )
示例3: print_enc
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import rights [as 别名]
print_enc("")
exit()
arg = sys.argv[1]
fg = FeedGenerator()
fg.id("http://lernfunk.de/_MEDIAID_123")
fg.title("Testfeed")
fg.author({"name": "Lars Kiesow", "email": "[email protected]"})
fg.link(href="http://example.com", rel="alternate")
fg.category(term="test")
fg.contributor(name="Lars Kiesow", email="[email protected]")
fg.contributor(name="John Doe", email="[email protected]")
fg.icon("http://ex.com/icon.jpg")
fg.logo("http://ex.com/logo.jpg")
fg.rights("cc-by")
fg.subtitle("This is a cool feed!")
fg.link(href="http://larskiesow.de/test.atom", rel="self")
fg.language("de")
fe = fg.add_entry()
fe.id("http://lernfunk.de/_MEDIAID_123#1")
fe.title("First Element")
fe.content(
"""Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tamen
aberramus a proposito, et, ne longius, prorsus, inquam, Piso, si ista
mala sunt, placet. Aut etiam, ut vestitum, sic sententiam habeas aliam
domesticam, aliam forensem, ut in fronte ostentatio sit, intus veritas
occultetur? Cum id fugiunt, re eadem defendunt, quae Peripatetici,
verba."""
)
fe.summary(u"Lorem ipsum dolor sit amet, consectetur adipiscing elit…")
示例4: range
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import rights [as 别名]
nodelist = Orgnode.makelist(sys.argv[1])
info = nodelist[0]
properties = info.Properties()
fg.podcast.itunes_category('Technology', 'Podcasting')
fg.title(info.Heading())
fg.author( {'name':properties['author'],'email':properties['email']} )
fg.id(properties["id"])
fg.link( href='http://whoomin.marboo.biz', rel='alternate' )
fg.logo(properties["logo"])
fg.subtitle(properties["subtitle"])
fg.link(href=properties["link"], rel='self' )
fg.language(properties["language"])
fg.image(properties["image"], height="140", width="140")
fg.rights(properties["copyright"])
fg.podcast.itunes_author(properties["author"])
fg.podcast.itunes_subtitle(properties["subtitle"])
fg.podcast.itunes_summary(properties["summary"])
#fg.podcast.itunes_keywords(properties["keywords"])
#fg.ttl(1440)
for i in range(1, len(nodelist)):
node = nodelist[i]
if node.Todo() == "DRAFT":
continue
mp3_length = "1024"
fe = fg.add_entry()
title = node.Heading()
category = {"term": node.Tag(), "scheme":"", "label":""}
示例5: main
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import rights [as 别名]
def main():
if len(sys.argv) != 2 or not (
sys.argv[1].endswith('rss') or
sys.argv[1].endswith('atom') or
sys.argv[1] == 'torrent' or
sys.argv[1] == 'podcast'):
print(USAGE)
exit()
arg = sys.argv[1]
fg = FeedGenerator()
fg.id('http://lernfunk.de/_MEDIAID_123')
fg.title('Testfeed')
fg.author({'name': 'Lars Kiesow', 'email': '[email protected]'})
fg.link(href='http://example.com', rel='alternate')
fg.category(term='test')
fg.contributor(name='Lars Kiesow', email='[email protected]')
fg.contributor(name='John Doe', email='[email protected]')
fg.icon('http://ex.com/icon.jpg')
fg.logo('http://ex.com/logo.jpg')
fg.rights('cc-by')
fg.subtitle('This is a cool feed!')
fg.link(href='http://larskiesow.de/test.atom', rel='self')
fg.language('de')
fe = fg.add_entry()
fe.id('http://lernfunk.de/_MEDIAID_123#1')
fe.title('First Element')
fe.content('''Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tamen
aberramus a proposito, et, ne longius, prorsus, inquam, Piso, si
ista mala sunt, placet. Aut etiam, ut vestitum, sic sententiam
habeas aliam domesticam, aliam forensem, ut in fronte ostentatio
sit, intus veritas occultetur? Cum id fugiunt, re eadem defendunt,
quae Peripatetici, verba.''')
fe.summary(u'Lorem ipsum dolor sit amet, consectetur adipiscing elit…')
fe.link(href='http://example.com', rel='alternate')
fe.author(name='Lars Kiesow', email='[email protected]')
if arg == 'atom':
print_enc(fg.atom_str(pretty=True))
elif arg == 'rss':
print_enc(fg.rss_str(pretty=True))
elif arg == 'podcast':
# Load the podcast extension. It will automatically be loaded for all
# entries in the feed, too. Thus also for our “fe”.
fg.load_extension('podcast')
fg.podcast.itunes_author('Lars Kiesow')
fg.podcast.itunes_category('Technology', 'Podcasting')
fg.podcast.itunes_explicit('no')
fg.podcast.itunes_complete('no')
fg.podcast.itunes_new_feed_url('http://example.com/new-feed.rss')
fg.podcast.itunes_owner('John Doe', '[email protected]')
fg.podcast.itunes_summary('Lorem ipsum dolor sit amet, consectetur ' +
'adipiscing elit. Verba tu fingas et ea ' +
'dicas, quae non sentias?')
fe.podcast.itunes_author('Lars Kiesow')
print_enc(fg.rss_str(pretty=True))
elif arg == 'torrent':
fg.load_extension('torrent')
fe.link(href='http://example.com/torrent/debian-8-netint.iso.torrent',
rel='alternate',
type='application/x-bittorrent, length=1000')
fe.torrent.filename('debian-8.4.0-i386-netint.iso.torrent')
fe.torrent.infohash('7661229811ef32014879ceedcdf4a48f256c88ba')
fe.torrent.contentlength('331350016')
fe.torrent.seeds('789')
fe.torrent.peers('456')
fe.torrent.verified('123')
print_enc(fg.rss_str(pretty=True))
elif arg.startswith('dc.'):
fg.load_extension('dc')
fg.dc.dc_contributor('Lars Kiesow')
if arg.endswith('.atom'):
print_enc(fg.atom_str(pretty=True))
else:
print_enc(fg.rss_str(pretty=True))
elif arg.startswith('syndication'):
fg.load_extension('syndication')
fg.syndication.update_period('daily')
fg.syndication.update_frequency(2)
fg.syndication.update_base('2000-01-01T12:00+00:00')
if arg.endswith('.rss'):
print_enc(fg.rss_str(pretty=True))
else:
print_enc(fg.atom_str(pretty=True))
elif arg.endswith('atom'):
fg.atom_file(arg)
elif arg.endswith('rss'):
fg.rss_file(arg)