Example #1
0
 def __init__(self,
              title,
              link,
              description,
              language=None,
              author_email=None,
              author_name=None,
              author_link=None,
              subtitle=None,
              categories=None,
              feed_url=None,
              feed_copyright=None,
              feed_guid=None,
              ttl=None,
              **kwargs):
     if categories:
         categories = [force_unicode(c) for c in categories]
     self.feed = {
         'title': title,
         'link': iri_to_uri(link),
         'description': description,
         'language': language,
         'author_email': author_email,
         'author_name': author_name,
         'author_link': iri_to_uri(author_link),
         'subtitle': subtitle,
         'categories': categories or (),
         'feed_url': iri_to_uri(feed_url),
         'feed_copyright': feed_copyright,
         'id': feed_guid or link,
         'ttl': ttl,
     }
     self.feed.update(kwargs)
     self.items = []
Example #2
0
 def add_item(self, title, link, description, author_email=None,
     author_name=None, author_link=None, pubdate=None, comments=None,
     unique_id=None, enclosure=None, categories=(), item_copyright=None,
     ttl=None, **kwargs):
     """
     Adds an item to the feed. All args are expected to be Python Unicode
     objects except pubdate, which is a datetime.datetime object, and
     enclosure, which is an instance of the Enclosure class.
     """
     item = {
         'title': title,
         'link': iri_to_uri(link),
         'description': description,
         'author_email': author_email,
         'author_name': author_name,
         'author_link': iri_to_uri(author_link),
         'pubdate': pubdate,
         'comments': comments,
         'unique_id': unique_id,
         'enclosure': enclosure,
         'categories': categories or (),
         'item_copyright': item_copyright,
         'ttl': ttl,
     }
     item.update(kwargs)
     self.items.append(item)
Example #3
0
 def __init__(self, title, link, description, language=None, author_email=None,
         author_name=None, author_link=None, subtitle=None, categories=None,
         feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs):
     if categories:
         categories = [force_unicode(c) for c in categories]
     self.feed = {
         'title': title,
         'link': iri_to_uri(link),
         'description': description,
         'language': language,
         'author_email': author_email,
         'author_name': author_name,
         'author_link': iri_to_uri(author_link),
         'subtitle': subtitle,
         'categories': categories or (),
         'feed_url': iri_to_uri(feed_url),
         'feed_copyright': feed_copyright,
         'id': feed_guid or link,
         'ttl': ttl,
     }
     self.feed.update(kwargs)
     self.items = []
Example #4
0
 def add_item(
     self,
     title,
     link,
     description,
     author_email=None,
     author_name=None,
     author_link=None,
     pubdate=None,
     comments=None,
     unique_id=None,
     enclosure=None,
     categories=(),
     item_copyright=None,
     ttl=None,
     **kwargs
 ):
     """
     Adds an item to the feed. All args are expected to be Python Unicode
     objects except pubdate, which is a datetime.datetime object, and
     enclosure, which is an instance of the Enclosure class.
     """
     item = {
         "title": title,
         "link": iri_to_uri(link),
         "description": description,
         "author_email": author_email,
         "author_name": author_name,
         "author_link": iri_to_uri(author_link),
         "pubdate": pubdate,
         "comments": comments,
         "unique_id": unique_id,
         "enclosure": enclosure,
         "categories": categories or (),
         "item_copyright": item_copyright,
         "ttl": ttl,
     }
     item.update(kwargs)
     self.items.append(item)
Example #5
0
 def add_item(self,
              title,
              link,
              description,
              author_email=None,
              author_name=None,
              author_link=None,
              pubdate=None,
              comments=None,
              unique_id=None,
              enclosure=None,
              categories=(),
              item_copyright=None,
              ttl=None,
              **kwargs):
     """
     Adds an item to the feed. All args are expected to be Python Unicode
     objects except pubdate, which is a datetime.datetime object, and
     enclosure, which is an instance of the Enclosure class.
     """
     item = {
         'title': title,
         'link': iri_to_uri(link),
         'description': description,
         'author_email': author_email,
         'author_name': author_name,
         'author_link': iri_to_uri(author_link),
         'pubdate': pubdate,
         'comments': comments,
         'unique_id': unique_id,
         'enclosure': enclosure,
         'categories': categories or (),
         'item_copyright': item_copyright,
         'ttl': ttl,
     }
     item.update(kwargs)
     self.items.append(item)
Example #6
0
 def __init__(
     self,
     title,
     link,
     description,
     language=None,
     author_email=None,
     author_name=None,
     author_link=None,
     subtitle=None,
     categories=None,
     feed_url=None,
     feed_copyright=None,
     feed_guid=None,
     ttl=None,
     **kwargs
 ):
     if categories:
         categories = [force_unicode(c) for c in categories]
     self.feed = {
         "title": title,
         "link": iri_to_uri(link),
         "description": description,
         "language": language,
         "author_email": author_email,
         "author_name": author_name,
         "author_link": iri_to_uri(author_link),
         "subtitle": subtitle,
         "categories": categories or (),
         "feed_url": iri_to_uri(feed_url),
         "feed_copyright": feed_copyright,
         "id": feed_guid or link,
         "ttl": ttl,
     }
     self.feed.update(kwargs)
     self.items = []
Example #7
0
 def __init__(self, url, length, mime_type):
     "All args are expected to be Python Unicode objects"
     self.length, self.mime_type = length, mime_type
     self.url = iri_to_uri(url)
Example #8
0
 def __init__(self, url, length, mime_type):
     "All args are expected to be Python Unicode objects"
     self.length, self.mime_type = length, mime_type
     self.url = iri_to_uri(url)