paul@13 | 1 | # -*- coding: iso-8859-1 -*- |
paul@13 | 2 | """ |
paul@13 | 3 | MoinMoin - SharedContent macro, based on the FeedReader macro |
paul@13 | 4 | |
paul@18 | 5 | @copyright: 2008, 2012, 2013 by Paul Boddie <paul@boddie.org.uk> |
paul@13 | 6 | @license: GNU GPL (v2 or later), see COPYING.txt for details. |
paul@13 | 7 | """ |
paul@13 | 8 | |
paul@24 | 9 | from DateSupport import getDateTimeFromISO8601, DateTime |
paul@13 | 10 | from MoinMoin.Page import Page |
paul@14 | 11 | from MoinRemoteSupport import * |
paul@32 | 12 | from MoinSupport import parseMacroArguments, getParsersForContentType, formatText |
paul@34 | 13 | from MoinShare import getUpdateSources, getUpdatesFromPage, \ |
paul@40 | 14 | getUpdatesFromStore, getUpdateFromPart, \ |
paul@40 | 15 | Update, get_make_parser |
paul@22 | 16 | from email.utils import parsedate |
paul@13 | 17 | import xml.dom.pulldom |
paul@13 | 18 | |
paul@14 | 19 | try: |
paul@14 | 20 | from cStringIO import StringIO |
paul@14 | 21 | except ImportError: |
paul@14 | 22 | from StringIO import StringIO |
paul@14 | 23 | |
paul@13 | 24 | Dependencies = ["time"] |
paul@13 | 25 | |
paul@13 | 26 | MAX_ENTRIES = 5 |
paul@13 | 27 | ATOM_NS = "http://www.w3.org/2005/Atom" |
paul@13 | 28 | |
paul@22 | 29 | # Utility functions. |
paul@22 | 30 | |
paul@13 | 31 | def text(element): |
paul@13 | 32 | nodes = [] |
paul@13 | 33 | for node in element.childNodes: |
paul@13 | 34 | if node.nodeType == node.TEXT_NODE: |
paul@13 | 35 | nodes.append(node.nodeValue) |
paul@13 | 36 | return "".join(nodes) |
paul@13 | 37 | |
paul@32 | 38 | def children(element): |
paul@32 | 39 | nodes = [] |
paul@32 | 40 | for node in element.childNodes: |
paul@32 | 41 | nodes.append(node.toxml()) |
paul@32 | 42 | return "".join(nodes) |
paul@32 | 43 | |
paul@20 | 44 | def unescape(text): |
paul@20 | 45 | return text.replace("<", "<").replace(">", ">").replace("&", "&") |
paul@20 | 46 | |
paul@13 | 47 | def linktext(element, feed_type): |
paul@13 | 48 | if feed_type == "rss": |
paul@13 | 49 | return text(element) |
paul@13 | 50 | else: |
paul@13 | 51 | return element.getAttribute("href") |
paul@13 | 52 | |
paul@29 | 53 | def need_content(show_content, tagname): |
paul@29 | 54 | return show_content in ("content", "description") and tagname in ("content", "description") |
paul@29 | 55 | |
paul@22 | 56 | # Error classes. |
paul@22 | 57 | |
paul@22 | 58 | class FeedError(Exception): |
paul@22 | 59 | pass |
paul@22 | 60 | |
paul@22 | 61 | class FeedMissingError(FeedError): |
paul@22 | 62 | pass |
paul@13 | 63 | |
paul@22 | 64 | class FeedContentTypeError(FeedError): |
paul@22 | 65 | pass |
paul@22 | 66 | |
paul@22 | 67 | # Feed retrieval. |
paul@20 | 68 | |
paul@28 | 69 | def getUpdates(request, feed_url, max_entries, show_content): |
paul@22 | 70 | |
paul@22 | 71 | """ |
paul@22 | 72 | Using the given 'request', retrieve from 'feed_url' up to the given number |
paul@28 | 73 | 'max_entries' of update entries. The 'show_content' parameter can indicate |
paul@28 | 74 | that a "summary" is to be obtained for each update, that the "content" of |
paul@28 | 75 | each update is to be obtained (falling back to a summary if no content is |
paul@28 | 76 | provided), or no content (indicated by a false value) is to be obtained. |
paul@22 | 77 | |
paul@22 | 78 | A tuple of the form ((feed_type, channel_title, channel_link), updates) is |
paul@22 | 79 | returned. |
paul@22 | 80 | """ |
paul@22 | 81 | |
paul@22 | 82 | feed_updates = [] |
paul@13 | 83 | |
paul@14 | 84 | # Obtain the resource, using a cached version if appropriate. |
paul@13 | 85 | |
paul@14 | 86 | max_cache_age = int(getattr(request.cfg, "moin_share_max_cache_age", "300")) |
paul@14 | 87 | data = getCachedResource(request, feed_url, "MoinShare", "wiki", max_cache_age) |
paul@14 | 88 | if not data: |
paul@22 | 89 | raise FeedMissingError |
paul@22 | 90 | |
paul@22 | 91 | # Interpret the cached feed. |
paul@14 | 92 | |
paul@14 | 93 | feed = StringIO(data) |
paul@20 | 94 | _url, content_type, _encoding, _metadata = getCachedResourceMetadata(feed) |
paul@20 | 95 | |
paul@27 | 96 | if content_type not in ("application/atom+xml", "application/rss+xml", "application/xml"): |
paul@22 | 97 | raise FeedContentTypeError |
paul@13 | 98 | |
paul@13 | 99 | try: |
paul@13 | 100 | # Parse each node from the feed. |
paul@13 | 101 | |
paul@13 | 102 | channel_title = channel_link = None |
paul@13 | 103 | |
paul@13 | 104 | feed_type = None |
paul@22 | 105 | update = None |
paul@27 | 106 | in_source = False |
paul@13 | 107 | |
paul@13 | 108 | events = xml.dom.pulldom.parse(feed) |
paul@13 | 109 | |
paul@13 | 110 | for event, value in events: |
paul@13 | 111 | |
paul@27 | 112 | if not in_source and event == xml.dom.pulldom.START_ELEMENT: |
paul@13 | 113 | tagname = value.localName |
paul@13 | 114 | |
paul@13 | 115 | # Detect the feed type and items. |
paul@13 | 116 | |
paul@13 | 117 | if tagname == "feed" and value.namespaceURI == ATOM_NS: |
paul@13 | 118 | feed_type = "atom" |
paul@13 | 119 | |
paul@13 | 120 | elif tagname == "rss": |
paul@13 | 121 | feed_type = "rss" |
paul@13 | 122 | |
paul@13 | 123 | # Detect items. |
paul@13 | 124 | |
paul@13 | 125 | elif feed_type == "rss" and tagname == "item" or \ |
paul@13 | 126 | feed_type == "atom" and tagname == "entry": |
paul@13 | 127 | |
paul@22 | 128 | update = Update() |
paul@13 | 129 | |
paul@27 | 130 | # Detect source declarations. |
paul@27 | 131 | |
paul@27 | 132 | elif feed_type == "atom" and tagname == "source": |
paul@27 | 133 | in_source = True |
paul@27 | 134 | |
paul@27 | 135 | # Handle item elements. |
paul@27 | 136 | |
paul@13 | 137 | elif tagname == "title": |
paul@13 | 138 | events.expandNode(value) |
paul@22 | 139 | if update: |
paul@22 | 140 | update.title = text(value) |
paul@13 | 141 | else: |
paul@22 | 142 | channel_title = text(value) |
paul@13 | 143 | |
paul@13 | 144 | elif tagname == "link": |
paul@13 | 145 | events.expandNode(value) |
paul@22 | 146 | if update: |
paul@22 | 147 | update.link = linktext(value, feed_type) |
paul@13 | 148 | else: |
paul@22 | 149 | channel_link = linktext(value, feed_type) |
paul@13 | 150 | |
paul@29 | 151 | elif show_content and ( |
paul@29 | 152 | feed_type == "atom" and tagname in ("content", "summary") or |
paul@29 | 153 | feed_type == "rss" and tagname == "description"): |
paul@29 | 154 | |
paul@20 | 155 | events.expandNode(value) |
paul@28 | 156 | |
paul@28 | 157 | # Obtain content where requested or, failing that, a |
paul@28 | 158 | # summary. |
paul@28 | 159 | |
paul@29 | 160 | if update and (need_content(show_content, tagname) or tagname == "summary" and not update.content): |
paul@29 | 161 | if feed_type == "atom": |
paul@29 | 162 | update.content_type = value.getAttribute("type") or "text" |
paul@32 | 163 | |
paul@32 | 164 | # Normalise the content types and extract the |
paul@32 | 165 | # content. |
paul@32 | 166 | |
paul@29 | 167 | if update.content_type in ("xhtml", "application/xhtml+xml", "application/xml"): |
paul@32 | 168 | update.content = children(value) |
paul@32 | 169 | update.content_type = "application/xhtml+xml" |
paul@32 | 170 | elif update.content_type in ("html", "text/html"): |
paul@32 | 171 | update.content = text(value) |
paul@32 | 172 | update.content_type = "text/html" |
paul@29 | 173 | else: |
paul@29 | 174 | update.content = text(value) |
paul@32 | 175 | update.content_type = "text/plain" |
paul@27 | 176 | else: |
paul@32 | 177 | update.content_type = "text/html" |
paul@27 | 178 | update.content = text(value) |
paul@22 | 179 | |
paul@22 | 180 | elif feed_type == "atom" and tagname == "updated" or \ |
paul@22 | 181 | feed_type == "rss" and tagname == "pubDate": |
paul@29 | 182 | |
paul@22 | 183 | events.expandNode(value) |
paul@22 | 184 | |
paul@22 | 185 | if update: |
paul@22 | 186 | if feed_type == "atom": |
paul@24 | 187 | value = getDateTimeFromISO8601(text(value)) |
paul@22 | 188 | else: |
paul@22 | 189 | value = DateTime(parsedate(text(value))) |
paul@22 | 190 | update.updated = value |
paul@20 | 191 | |
paul@13 | 192 | elif event == xml.dom.pulldom.END_ELEMENT: |
paul@13 | 193 | tagname = value.localName |
paul@13 | 194 | |
paul@13 | 195 | if feed_type == "rss" and tagname == "item" or \ |
paul@13 | 196 | feed_type == "atom" and tagname == "entry": |
paul@13 | 197 | |
paul@23 | 198 | feed_updates.append(update) |
paul@20 | 199 | |
paul@22 | 200 | update = None |
paul@13 | 201 | |
paul@27 | 202 | elif feed_type == "atom" and tagname == "source": |
paul@27 | 203 | in_source = False |
paul@27 | 204 | |
paul@22 | 205 | finally: |
paul@22 | 206 | feed.close() |
paul@22 | 207 | |
paul@22 | 208 | return (feed_type, channel_title, channel_link), feed_updates |
paul@22 | 209 | |
paul@40 | 210 | # Update formatting. |
paul@40 | 211 | |
paul@40 | 212 | def getUpdatesForFormatting(update): |
paul@40 | 213 | |
paul@40 | 214 | "Get a list of updates for formatting given 'update'." |
paul@40 | 215 | |
paul@40 | 216 | updates = [] |
paul@40 | 217 | |
paul@40 | 218 | # Handle multipart/alternative. |
paul@40 | 219 | |
paul@40 | 220 | if update.parts: |
paul@40 | 221 | for n, part in enumerate(update.parts): |
paul@40 | 222 | update_part = getUpdateFromPart(update, part, n) |
paul@40 | 223 | updates += getUpdatesForFormatting(update_part) |
paul@40 | 224 | else: |
paul@40 | 225 | updates.append(update) |
paul@40 | 226 | |
paul@40 | 227 | return updates |
paul@40 | 228 | |
paul@40 | 229 | def getFormattedUpdate(update, request, fmt): |
paul@40 | 230 | |
paul@40 | 231 | """ |
paul@40 | 232 | Return the formatted form of the given 'update' using the given 'request' |
paul@40 | 233 | and 'fmt'. |
paul@40 | 234 | """ |
paul@40 | 235 | |
paul@40 | 236 | # NOTE: Some control over the HTML and XHTML should be exercised. |
paul@40 | 237 | |
paul@40 | 238 | if update.content: |
paul@40 | 239 | if update.content_type == "text/html" and update.message_number is not None: |
paul@40 | 240 | parsers = [get_make_parser(update.page, update.message_number)] |
paul@40 | 241 | else: |
paul@40 | 242 | parsers = getParsersForContentType(request.cfg, update.content_type) |
paul@40 | 243 | |
paul@40 | 244 | if parsers: |
paul@40 | 245 | for parser_cls in parsers: |
paul@40 | 246 | return formatText(update.content, request, fmt, parser_cls=parser_cls) |
paul@40 | 247 | break |
paul@40 | 248 | else: |
paul@40 | 249 | return None |
paul@40 | 250 | else: |
paul@40 | 251 | return None |
paul@40 | 252 | |
paul@40 | 253 | def formatUpdate(update, request, fmt): |
paul@40 | 254 | |
paul@40 | 255 | "Format the given 'update' using the given 'request' and 'fmt'." |
paul@40 | 256 | |
paul@40 | 257 | result = [] |
paul@40 | 258 | append = result.append |
paul@40 | 259 | |
paul@40 | 260 | updates = getUpdatesForFormatting(update) |
paul@40 | 261 | single = len(updates) == 1 |
paul@40 | 262 | |
paul@40 | 263 | # Format some navigation tabs. |
paul@40 | 264 | |
paul@40 | 265 | if not single: |
paul@40 | 266 | append(fmt.div(on=1, css_class="moinshare-alternatives")) |
paul@40 | 267 | |
paul@40 | 268 | first = True |
paul@40 | 269 | |
paul@40 | 270 | for update_part in updates: |
paul@40 | 271 | append(fmt.url(1, "#%s" % update_part.unique_id())) |
paul@40 | 272 | append(fmt.text(update_part.content_type)) |
paul@40 | 273 | append(fmt.url(0)) |
paul@40 | 274 | |
paul@40 | 275 | first = False |
paul@40 | 276 | |
paul@40 | 277 | append(fmt.div(on=0)) |
paul@40 | 278 | |
paul@40 | 279 | # Format the content. |
paul@40 | 280 | |
paul@40 | 281 | first = True |
paul@40 | 282 | |
paul@40 | 283 | for update_part in updates: |
paul@40 | 284 | |
paul@40 | 285 | # Encapsulate each alternative if many exist. |
paul@40 | 286 | |
paul@40 | 287 | if not single: |
paul@40 | 288 | css_class = first and "moinshare-default" or "moinshare-other" |
paul@40 | 289 | append(fmt.div(on=1, css_class="moinshare-alternative %s" % css_class, id=update_part.unique_id())) |
paul@40 | 290 | |
paul@40 | 291 | # Include the content. |
paul@40 | 292 | |
paul@40 | 293 | append(formatUpdatePart(update_part, request, fmt)) |
paul@40 | 294 | |
paul@40 | 295 | if not single: |
paul@40 | 296 | append(fmt.div(on=0)) |
paul@40 | 297 | |
paul@40 | 298 | first = False |
paul@40 | 299 | |
paul@40 | 300 | return "".join(result) |
paul@40 | 301 | |
paul@40 | 302 | def formatUpdatePart(update, request, fmt): |
paul@40 | 303 | |
paul@40 | 304 | "Format the given 'update' using the given 'request' and 'fmt'." |
paul@40 | 305 | |
paul@40 | 306 | _ = request.getText |
paul@40 | 307 | |
paul@40 | 308 | result = [] |
paul@40 | 309 | append = result.append |
paul@40 | 310 | |
paul@40 | 311 | # Encapsulate the content. |
paul@40 | 312 | |
paul@40 | 313 | append(fmt.div(on=1, css_class="moinshare-content")) |
paul@40 | 314 | text = getFormattedUpdate(update, request, fmt) |
paul@40 | 315 | if text: |
paul@40 | 316 | append(text) |
paul@40 | 317 | else: |
paul@40 | 318 | append(fmt.text(_("Update cannot be shown for content of type %s.") % update.content_type)) |
paul@40 | 319 | append(fmt.div(on=0)) |
paul@40 | 320 | |
paul@40 | 321 | return "".join(result) |
paul@40 | 322 | |
paul@22 | 323 | # The macro itself. |
paul@22 | 324 | |
paul@22 | 325 | def execute(macro, args): |
paul@22 | 326 | request = macro.request |
paul@22 | 327 | fmt = macro.formatter |
paul@22 | 328 | _ = request.getText |
paul@22 | 329 | |
paul@31 | 330 | source_pages = [] |
paul@22 | 331 | show_content = None |
paul@22 | 332 | max_entries = None |
paul@22 | 333 | |
paul@22 | 334 | for arg, value in parseMacroArguments(args): |
paul@31 | 335 | if arg == "sources": |
paul@31 | 336 | source_pages.append(value) |
paul@22 | 337 | elif arg == "show": |
paul@28 | 338 | show_content = value.lower() |
paul@22 | 339 | elif arg == "limit": |
paul@22 | 340 | try: |
paul@22 | 341 | max_entries = int(value) |
paul@22 | 342 | except ValueError: |
paul@22 | 343 | return fmt.text(_("SharedContent: limit must be set to the maximum number of entries to be shown")) |
paul@22 | 344 | |
paul@31 | 345 | if not source_pages: |
paul@31 | 346 | return fmt.text(_("SharedContent: at least one sources page must be specified")) |
paul@31 | 347 | |
paul@31 | 348 | sources = {} |
paul@31 | 349 | |
paul@31 | 350 | for source_page in source_pages: |
paul@31 | 351 | sources.update(getUpdateSources(source_page, request)) |
paul@31 | 352 | |
paul@31 | 353 | if not sources: |
paul@31 | 354 | return fmt.text(_("SharedContent: at least one update source must be specified")) |
paul@22 | 355 | |
paul@22 | 356 | show_content = show_content or False |
paul@22 | 357 | max_entries = max_entries or MAX_ENTRIES |
paul@22 | 358 | |
paul@31 | 359 | # Retrieve updates, classifying them as missing or bad and excluding them if |
paul@31 | 360 | # appropriate. |
paul@23 | 361 | |
paul@22 | 362 | updates = [] |
paul@22 | 363 | feeds = [] |
paul@31 | 364 | unspecified = [] |
paul@22 | 365 | missing = [] |
paul@22 | 366 | bad_content = [] |
paul@13 | 367 | |
paul@31 | 368 | for source_name, source_parameters in sources.items(): |
paul@31 | 369 | location = source_parameters.get("location") |
paul@31 | 370 | if not location: |
paul@31 | 371 | unspecified.append(source_name) |
paul@31 | 372 | continue |
paul@31 | 373 | |
paul@22 | 374 | try: |
paul@31 | 375 | max_entries_for_feed = int(source_parameters["limit"]) |
paul@31 | 376 | except (KeyError, ValueError): |
paul@31 | 377 | max_entries_for_feed = None |
paul@22 | 378 | |
paul@31 | 379 | # Retrieve updates from feeds. |
paul@30 | 380 | |
paul@31 | 381 | if source_parameters.get("type") == "url": |
paul@31 | 382 | try: |
paul@35 | 383 | feed_info, feed_updates = getUpdates(request, location, max_entries_for_feed, show_content) |
paul@31 | 384 | updates += feed_updates |
paul@31 | 385 | feeds.append((location, feed_info)) |
paul@31 | 386 | except FeedMissingError: |
paul@31 | 387 | missing.append(location) |
paul@31 | 388 | except FeedContentTypeError: |
paul@31 | 389 | bad_content.append(location) |
paul@30 | 390 | |
paul@31 | 391 | # Retrieve updates from pages. |
paul@30 | 392 | |
paul@31 | 393 | elif source_parameters.get("type") == "page": |
paul@31 | 394 | page = Page(request, location) |
paul@31 | 395 | updates += getUpdatesFromPage(page, request) |
paul@31 | 396 | |
paul@31 | 397 | # Build feed-equivalent information for the update source. |
paul@31 | 398 | |
paul@31 | 399 | feeds.append(( |
paul@31 | 400 | page.url(request, {"action" : "SharedUpdates", "doit" : "1"}), ( |
paul@31 | 401 | "internal", _("Updates from page %s") % location, |
paul@31 | 402 | page.url(request) |
paul@31 | 403 | ) |
paul@31 | 404 | )) |
paul@30 | 405 | |
paul@33 | 406 | # Retrieve updates from message stores. |
paul@33 | 407 | |
paul@33 | 408 | elif source_parameters.get("type") == "store": |
paul@33 | 409 | page = Page(request, location) |
paul@33 | 410 | updates += getUpdatesFromStore(page, request) |
paul@33 | 411 | |
paul@33 | 412 | # Build feed-equivalent information for the update source. |
paul@33 | 413 | |
paul@33 | 414 | feeds.append(( |
paul@33 | 415 | page.url(request, {"action" : "SharedUpdates", "store" : "1", "doit" : "1"}), ( |
paul@33 | 416 | "internal", _("Updates from message store on page %s") % location, |
paul@33 | 417 | page.url(request) |
paul@33 | 418 | ) |
paul@33 | 419 | )) |
paul@33 | 420 | |
paul@30 | 421 | # Prepare the output. |
paul@30 | 422 | |
paul@22 | 423 | output = [] |
paul@22 | 424 | append = output.append |
paul@22 | 425 | |
paul@22 | 426 | # Show the updates. |
paul@22 | 427 | |
paul@22 | 428 | if not show_content: |
paul@22 | 429 | append(fmt.bullet_list(on=1)) |
paul@22 | 430 | |
paul@22 | 431 | # NOTE: Permit configurable sorting. |
paul@22 | 432 | |
paul@22 | 433 | updates.sort() |
paul@22 | 434 | updates.reverse() |
paul@22 | 435 | |
paul@23 | 436 | # Truncate the number of updates to the maximum number. |
paul@23 | 437 | |
paul@23 | 438 | updates = updates[:max_entries] |
paul@23 | 439 | |
paul@22 | 440 | for update in updates: |
paul@22 | 441 | |
paul@22 | 442 | # Emit content where appropriate. |
paul@22 | 443 | |
paul@22 | 444 | if show_content: |
paul@22 | 445 | append(fmt.div(on=1, css_class="moinshare-update")) |
paul@38 | 446 | |
paul@40 | 447 | append(formatUpdate(update, request, fmt)) |
paul@32 | 448 | |
paul@24 | 449 | append(fmt.div(on=1, css_class="moinshare-date")) |
paul@24 | 450 | append(fmt.text(str(update.updated))) |
paul@24 | 451 | append(fmt.div(on=0)) |
paul@40 | 452 | |
paul@24 | 453 | append(fmt.div(on=0)) |
paul@22 | 454 | |
paul@22 | 455 | # Or emit title and link information for items. |
paul@22 | 456 | |
paul@22 | 457 | elif update.title and update.link: |
paul@22 | 458 | append(fmt.listitem(on=1, css_class="moinshare-update")) |
paul@22 | 459 | append(fmt.url(on=1, href=update.link)) |
paul@22 | 460 | append(fmt.icon('www')) |
paul@22 | 461 | append(fmt.text(" " + update.title)) |
paul@22 | 462 | append(fmt.url(on=0)) |
paul@22 | 463 | append(fmt.listitem(on=0)) |
paul@22 | 464 | |
paul@22 | 465 | if not show_content: |
paul@22 | 466 | append(fmt.bullet_list(on=0)) |
paul@22 | 467 | |
paul@22 | 468 | # Show the feeds. |
paul@22 | 469 | |
paul@26 | 470 | for feed_url, (feed_type, channel_title, channel_link) in feeds: |
paul@13 | 471 | if channel_title and channel_link: |
paul@22 | 472 | append(fmt.paragraph(on=1, css_class="moinshare-feed")) |
paul@22 | 473 | append(fmt.url(on=1, href=channel_link)) |
paul@22 | 474 | append(fmt.text(channel_title)) |
paul@13 | 475 | append(fmt.url(on=0)) |
paul@13 | 476 | append(fmt.text(" ")) |
paul@13 | 477 | append(fmt.url(on=1, href=feed_url)) |
paul@13 | 478 | append(fmt.icon('rss')) |
paul@13 | 479 | append(fmt.url(on=0)) |
paul@13 | 480 | append(fmt.paragraph(on=0)) |
paul@13 | 481 | |
paul@22 | 482 | # Show errors. |
paul@22 | 483 | |
paul@22 | 484 | for feed_url in missing: |
paul@22 | 485 | append(fmt.paragraph(on=1, css_class="moinshare-missing-feed-error")) |
paul@22 | 486 | append(fmt.text(_("SharedContent: updates could not be retrieved for %s") % feed_url)) |
paul@22 | 487 | append(fmt.paragraph(on=0)) |
paul@22 | 488 | |
paul@22 | 489 | for feed_url in bad_content: |
paul@22 | 490 | append(fmt.paragraph(on=1, css_class="moinshare-content-type-feed-error")) |
paul@22 | 491 | return fmt.text(_("SharedContent: updates for %s were not provided in Atom or RSS format") % feed_url) |
paul@22 | 492 | append(fmt.paragraph(on=0)) |
paul@13 | 493 | |
paul@13 | 494 | return ''.join(output) |
paul@13 | 495 | |
paul@13 | 496 | # vim: tabstop=4 expandtab shiftwidth=4 |