changeset 5842:97e36f417f6e

action/rss_rc.py: preserving show_names configuration option.
author Eugene Syromyatnikov <evgsyr@gmail.com>
date Wed, 16 May 2012 06:23:28 +0400
parents 8b3c4b85921b
children 89fbca5396a1
files MoinMoin/action/rss_rc.py
diffstat 1 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/rss_rc.py	Wed May 16 15:42:09 2012 +0400
+++ b/MoinMoin/action/rss_rc.py	Wed May 16 06:23:28 2012 +0400
@@ -232,24 +232,25 @@
                 handler.simpleNode('description', desc_text)
 
             # contributor
-            edattr = {}
-            if cfg.show_hosts:
-                edattr[(handler.xmlns['wiki'], 'host')] = item.hostname
-            if item.editor[0] == 'interwiki':
-                edname = "%s:%s" % item.editor[1]
-                ##edattr[(None, 'link')] = baseurl + wikiutil.quoteWikiname(edname)
-            else: # 'ip'
-                edname = item.editor[1]
-                ##edattr[(None, 'link')] = link + "?action=info"
+            if cfg.show_names:
+                edattr = {}
+                if cfg.show_hosts:
+                    edattr[(handler.xmlns['wiki'], 'host')] = item.hostname
+                if item.editor[0] == 'interwiki':
+                    edname = "%s:%s" % item.editor[1]
+                    ##edattr[(None, 'link')] = baseurl + wikiutil.quoteWikiname(edname)
+                else: # 'ip'
+                    edname = item.editor[1]
+                    ##edattr[(None, 'link')] = link + "?action=info"
 
-            # this edattr stuff, esp. None as first tuple element breaks things (tracebacks)
-            # if you know how to do this right, please send us a patch
+                # this edattr stuff, esp. None as first tuple element breaks things (tracebacks)
+                # if you know how to do this right, please send us a patch
 
-            handler.startNode(('dc', 'contributor'))
-            handler.startNode(('rdf', 'Description'), attr=edattr)
-            handler.simpleNode(('rdf', 'value'), edname)
-            handler.endNode(('rdf', 'Description'))
-            handler.endNode(('dc', 'contributor'))
+                handler.startNode(('dc', 'contributor'))
+                handler.startNode(('rdf', 'Description'), attr=edattr)
+                handler.simpleNode(('rdf', 'value'), edname)
+                handler.endNode(('rdf', 'Description'))
+                handler.endNode(('dc', 'contributor'))
 
             # wiki extensions
             handler.simpleNode(('wiki', 'version'), "%i" % (item.ed_time_usecs))