def GET(self, format, tags, command): if format == "atom/": context = Storage(self_url=request_uri(), ) web.header("content-type", "application/atom+xml") # proxying feed point i = web.input() datasources = model.Datasources(id=i.ds) ds = datasources.list()[0] feed_url = ds.url points = model.Points(internal=None, external=[feed_url]) points.filter_by_uuid(i.uuid) points.annotate_by_tags() for p in points: p.summary = _("No summary") # !!! points.last_activity() context.title = ds.description context.subtitle = _("from external sources") get_feed(context, items=points) return
def GET(self, format, tags, command): if format == "atom/": context = Storage(self_url=request_uri(),) web.header("content-type", "application/atom+xml") # proxying feed point i = web.input() datasources = model.Datasources(id=i.ds) ds = datasources.list()[0] feed_url = ds.url points = model.Points(internal=None, external=[feed_url]) points.filter_by_uuid(i.uuid) points.annotate_by_tags() for p in points: p.summary = _("No summary") # !!! points.last_activity() context.title = ds.description context.subtitle = _("from external sources") get_feed(context, items=points) return
def point_from_message(rfcmessage): msg = getAttachements(rfcmessage) sender = msg.sender[0][1] #!!! point = Storage( _recepients=msg.recepients, author=sender, author_name=msg.sender[0][0], id=msg.message_id, uuid="mail " + msg.message_id, ) attachments = [] lmxpoints = [] for ct, name, payload in msg.container: if "nokia.landmark" in ct or "text/xml" in ct: try: lmxfile = StringIO.StringIO(payload) lmxpoints = lmx_parser.parse_lmx(lmxfile) except: continue else: attachment = Storage( content=payload, content_type=ct, filename=name, author=sender, ) attachments.append(attachment) try: point.update(lmxpoints[0]) except: point.lat = point.lon = 0.0 # !!! not a point? point.attachments = attachments point.added = util.now() #!!!? if msg.subject.strip(): point.title = msg.subject # else title comes from landmark's name return point
def point_from_message(rfcmessage): msg = getAttachements(rfcmessage) sender = msg.sender[0][1] #!!! point = Storage(_recepients=msg.recepients, author=sender, author_name=msg.sender[0][0], id=msg.message_id, uuid="mail " + msg.message_id, ) attachments = [] lmxpoints = [] for ct, name, payload in msg.container: if "nokia.landmark" in ct or "text/xml" in ct: try: lmxfile = StringIO.StringIO(payload) lmxpoints = lmx_parser.parse_lmx(lmxfile) except: continue else: attachment = Storage( content=payload, content_type=ct, filename=name, author=sender, ) attachments.append(attachment) try: point.update(lmxpoints[0]) except: point.lat = point.lon = 0.0 # !!! not a point? point.attachments = attachments point.added = util.now() #!!!? if msg.subject.strip(): point.title = msg.subject # else title comes from landmark's name return point