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