Example #1
0
    def _to_internal_entry(self, entry, read_until=None):
        """Convert feed entries to internal data structure."""

        timestamp = entry.get("published_parsed", None)
        if timestamp is None:
            timestamp = entry.get("updated_parsed", None)
        if timestamp is None:
            return None

        published = calendar.timegm(timestamp)

        read = True
        if read_until is not None:
            read = published <= read_until

        return dict(title=entry["title"],
                    title_without_tags=_strip_tags(entry["title"]),
                    summary=_lazy_images(entry["summary"]),
                    summary_without_images=_strip_images(entry["summary"]),
                    published=published,
                    link=utmify(entry["link"],
                                source="octoprint",
                                medium="announcements",
                                content=OCTOPRINT_VERSION),
                    read=read)
Example #2
0
	def _to_internal_entry(self, entry, read_until=None):
		"""Convert feed entries to internal data structure."""

		published = calendar.timegm(entry["published_parsed"])

		read = True
		if read_until is not None:
			read = published <= read_until

		return dict(title=entry["title"],
		            title_without_tags=_strip_tags(entry["title"]),
		            summary=_lazy_images(entry["summary"]),
		            summary_without_images=_strip_images(entry["summary"]),
		            published=published,
		            link=utmify(entry["link"], source="octoprint", medium="announcements", content=OCTOPRINT_VERSION),
		            read=read)