本文整理汇总了Python中feedgen.feed.FeedGenerator.copyright方法的典型用法代码示例。如果您正苦于以下问题:Python FeedGenerator.copyright方法的具体用法?Python FeedGenerator.copyright怎么用?Python FeedGenerator.copyright使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feedgen.feed.FeedGenerator
的用法示例。
在下文中一共展示了FeedGenerator.copyright方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_feed_container
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import copyright [as 别名]
def create_feed_container(app):
#from feedformatter import Feed
feed = FeedGenerator()
feed.title(app.config.project)
feed.link(href=app.config.feed_base_url)
feed.author(dict(name=app.config.feed_author))
feed.description(app.config.feed_description)
if app.config.language:
feed.language(app.config.language)
if app.config.copyright:
feed.copyright(app.config.copyright)
app.builder.env.feed_feed = feed
if not hasattr(app.builder.env, 'feed_items'):
app.builder.env.feed_items = {}
示例2: len
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import copyright [as 别名]
RSS = len(args.rss) > 0
TZ = config.get('Common', 'timezone')
TWEET = args.tweet
SITE = config.get('Common', 'site')
if RSS:
rssfile = args.rss
rsstitle = config.get('RSS', 'rsstitle')
fg = FeedGenerator()
fg.title(rsstitle)
fg.description(config.get('RSS', 'rssdescription'))
rsslink = config.get('RSS', 'rsslink')
fg.link(href=rsslink, rel='self')
rssfeed = fg.rss_str(pretty=True)
fg.rss_file(rssfile)
fg.copyright(copyright="CC-BY 4.0")
rssauthor = {'name': config.get('RSS', 'rssauthorname'),
'email': config.get('RSS', 'rssauthoremail'),
}
fg.author(author=rssauthor, replace=True)
if TWEET:
APP_KEY = config.get('Twitter', 'appkey')
APP_SECRET = config.get('Twitter', 'appsecret')
OAUTH_TOKEN = config.get('Twitter', 'token')
OAUTH_TOKEN_SECRET = config.get('Twitter', 'tokensecret')
twitter = Twython(APP_KEY, APP_SECRET,
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
timezone = pytz.timezone(TZ)
today = datetime.now(timezone).date()
indir = os.path.join(DATADIR, str(today));
示例3: print_enc
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import copyright [as 别名]
from sqlalchemy import desc
def print_enc(s):
'''Print function compatible with both python2 and python3 accepting strings
and byte arrays.
'''
print(s.decode('utf-8') if type(s) == type(b'') else s)
fg = FeedGenerator()
fg.load_extension('podcast')
fg.title('The Crypto-Mises Podcast')
fg.podcast.itunes_author('Satoshi Nakamoto Institute')
fg.link( href='http://nakamotoinstitute.org/', rel='alternate' )
fg.subtitle('The official podcast of the Satoshi Nakamoto Institute')
fg.language('en')
fg.copyright('cc-by-sa')
fg.podcast.itunes_summary('Michael Goldstein and Daniel Krawisz of the Satoshi Nakamoto Institute discuss Bitcoin, economics, and cryptography.')
fg.podcast.itunes_owner('Michael Goldstein', '[email protected]')
fg.link( href='http://nakamotoinstitute.org/podcast/feed/', rel='self' )
fg.podcast.itunes_explicit('no')
fg.image('http://nakamotoinstitute.org/static/img/cryptomises/cmpodcast_144.jpg')
fg.podcast.itunes_image('http://nakamotoinstitute.org/static/img/cryptomises/cmpodcast_1440.jpg')
fg.podcast.itunes_category('Technology', 'Tech News')
eps = Episode.query.order_by(desc(Episode.date)).all()
for ep in eps:
fe = fg.add_entry()
fe.id('http://nakamotoinstitute/podcast/'+ep.slug+'/')
fe.title(ep.title)
示例4: setUp
# 需要导入模块: from feedgen.feed import FeedGenerator [as 别名]
# 或者: from feedgen.feed.FeedGenerator import copyright [as 别名]
def setUp(self):
fg = FeedGenerator()
self.nsAtom = "http://www.w3.org/2005/Atom"
self.nsRss = "http://purl.org/rss/1.0/modules/content/"
self.feedId = 'http://lernfunk.de/media/654321'
self.title = 'Some Testfeed'
self.authorName = 'John Doe'
self.authorMail = '[email protected]'
self.author = {'name': self.authorName, 'email': self.authorMail}
self.linkHref = 'http://example.com'
self.linkRel = 'alternate'
self.logo = 'http://ex.com/logo.jpg'
self.subtitle = 'This is a cool feed!'
self.link2Href = 'http://larskiesow.de/test.atom'
self.link2Rel = 'self'
self.language = 'en'
self.categoryTerm = 'This category term'
self.categoryScheme = 'This category scheme'
self.categoryLabel = 'This category label'
self.cloudDomain = 'example.com'
self.cloudPort = '4711'
self.cloudPath = '/ws/example'
self.cloudRegisterProcedure = 'registerProcedure'
self.cloudProtocol = 'SOAP 1.1'
self.icon = "http://example.com/icon.png"
self.contributor = {'name': "Contributor Name",
'uri': "Contributor Uri",
'email': 'Contributor email'}
self.copyright = "The copyright notice"
self.docs = 'http://www.rssboard.org/rss-specification'
self.managingEditor = '[email protected]'
self.rating = '(PICS-1.1 "http://www.classify.org/safesurf/" ' + \
'1 r (SS~~000 1))'
self.skipDays = 'Tuesday'
self.skipHours = 23
self.textInputTitle = "Text input title"
self.textInputDescription = "Text input description"
self.textInputName = "Text input name"
self.textInputLink = "Text input link"
self.ttl = 900
self.webMaster = '[email protected]'
fg.id(self.feedId)
fg.title(self.title)
fg.author(self.author)
fg.link(href=self.linkHref, rel=self.linkRel)
fg.logo(self.logo)
fg.subtitle(self.subtitle)
fg.link(href=self.link2Href, rel=self.link2Rel)
fg.language(self.language)
fg.cloud(domain=self.cloudDomain, port=self.cloudPort,
path=self.cloudPath,
registerProcedure=self.cloudRegisterProcedure,
protocol=self.cloudProtocol)
fg.icon(self.icon)
fg.category(term=self.categoryTerm, scheme=self.categoryScheme,
label=self.categoryLabel)
fg.contributor(self.contributor)
fg.copyright(self.copyright)
fg.docs(docs=self.docs)
fg.managingEditor(self.managingEditor)
fg.rating(self.rating)
fg.skipDays(self.skipDays)
fg.skipHours(self.skipHours)
fg.textInput(title=self.textInputTitle,
description=self.textInputDescription,
name=self.textInputName, link=self.textInputLink)
fg.ttl(self.ttl)
fg.webMaster(self.webMaster)
fg.updated('2017-02-05 13:26:58+01:00')
fg.pubDate('2017-02-05 13:26:58+01:00')
fg.generator('python-feedgen', 'x', uri='http://github.com/lkie...')
fg.image(url=self.logo,
title=self.title,
link=self.link2Href,
width='123',
height='123',
description='Example Inage')
self.fg = fg