def as_item(self): event = self.faultevent item = rss.Item() title = event.title faulttype = event.faulttype #item.title = rss.Title('%s: %s' % (title, faulttype)) item.title = rss.Title( '%s (%s): %s' % (title, 'P1', event.state.upper())) item.link = rss.Link( 'http://%s/syndication?guid=%s' % (event.origin, event.GUID)) item.pub_date = rss.PubDate(event.timestamp) description = event.description event_history = event.history + [event.current_event] for change in event_history: description += '<br />\n%s. ' % change.detail item.description = rss.Description(tools.escape_html(description)) item.guid = rss.Guid(event.GUID) item.source = rss.Source( event.LOCALORIGIN, 'http://%s/syndication' % event.LOCALORIGIN) for category in event.types: item.categories.append(rss.Category(category)) return item
def as_item(self): event = self.faultevent item = rss.Item() title = event.title faulttype = event.faulttype #item.title = rss.Title('%s: %s' % (title, faulttype)) item.title = rss.Title('%s (%s): %s' % (title, 'P1', event.state.upper())) item.link = rss.Link('http://%s/syndication?guid=%s' % (event.origin, event.GUID)) item.pub_date = rss.PubDate(event.timestamp) description = event.description event_history = event.history + [event.current_event] for change in event_history: description += '<br />\n%s. ' % change.detail item.description = rss.Description(tools.escape_html(description)) item.guid = rss.Guid(event.GUID) item.source = rss.Source(event.LOCALORIGIN, 'http://%s/syndication' % event.LOCALORIGIN) for category in event.types: item.categories.append(rss.Category(category)) return item
def as_item(self): event = self.alarmevent item = rss.Item() alarm = event.source priority = alarm.priority if not priority: priority = 'Normal' title = "%s (%s): %s" % (alarm.name, priority, event.state.upper()) link = "http://%s/syndication?guid=%s" % (event.origin, event.GUID) item.title = rss.Title(title) item.link = rss.Link(link) item.guid = rss.Guid(event.GUID) item.pub_date = rss.PubDate(event.created()) description = alarm.description for change in event.get_audit(): description += '<br />\n%s. ' % change.tostring() item.description = rss.Description(tools.escape_html(description)) item.source = rss.Source(event.origin, "http://%s/syndication" % event.origin) eventcategory = rss.Category('Event') alarmcategory = rss.Category('Alarm') item.categories.append(eventcategory) item.categories.append(alarmcategory) return item
xmldoc.xml_decl.attrs["encoding"] = "" channel.title = "Liftoff News" channel.link = "http://liftoff.msfc.nasa.gov/" channel.description = "Liftoff to Space Exploration." channel.language = "en-us" channel.pub_date = "Tue, 10 Jun 2003 04:00:00 GMT" channel.last_build_date = "Tue, 10 Jun 2003 09:41:01 GMT" channel.generator = "Weblog Editor 2.0" channel.managing_editor = "*****@*****.**" channel.web_master = "*****@*****.**" item = Item() s = """Sky watchers in Europe, Asia, and parts of Alaska and Canada will experience a <a href="http://science.nasa.gov/headlines/y2003/30may_solareclipse.htm">partial eclipse of the Sun</a> on Saturday, May 31st.""" item.description = escape_html(s) item.pub_date = "Fri, 30 May 2003 11:06:42 GMT" item.guid = "http://liftoff.msfc.nasa.gov/2003/05/30.html#item572" channel.items.append(item) item = Item() item.title = "The Engine That Does More" item.link = "http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp" s = """Before man travels to Mars, NASA hopes to design new engines that will let us fly through the Solar System more quickly. The proposed VASIMR engine would do that.""" item.description = escape_html(s) item.pub_date = "Tue, 27 May 2003 08:37:32 GMT" item.guid = "http://liftoff.msfc.nasa.gov/2003/05/27.html#item571" channel.items.append(item) item = Item() item.title = "Astronauts' Dirty Laundry"