changeset 399:7ce195b2189a

moved .langAttr() from formatter.text_html to formatter.base to fix FootNote macro for all non HTML formatters imported from: moin--main--1.5--patch-403
author Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
date Thu, 26 Jan 2006 21:57:38 +0000
parents e2c8b5f438a7
children 850c6ba2dd23
files ChangeLog MoinMoin/formatter/base.py MoinMoin/formatter/text_html.py
diffstat 3 files changed, 36 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 26 13:30:03 2006 +0000
+++ b/ChangeLog	Thu Jan 26 21:57:38 2006 +0000
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-01-26 22:57:38 GMT	Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>	patch-403
+
+    Summary:
+      moved .langAttr() from formatter.text_html to formatter.base to fix FootNote macro for all non HTML formatters
+    Revision:
+      moin--main--1.5--patch-403
+
+    moved .langAttr() from formatter.text_html to formatter.base to fix FootNote macro for all non HTML formatters
+    
+
+    modified files:
+     ChangeLog MoinMoin/formatter/base.py
+     MoinMoin/formatter/text_html.py
+
+
 2006-01-26 14:30:03 GMT	Alexander Schremmer <alex@alexanderweb.de.tla>	patch-402
 
     Summary:
--- a/MoinMoin/formatter/base.py	Thu Jan 26 13:30:03 2006 +0000
+++ b/MoinMoin/formatter/base.py	Thu Jan 26 21:57:38 2006 +0000
@@ -41,6 +41,27 @@
         else:
             self._highlight_re = hi_re
 
+    def langAttr(self, lang=None):
+        """ Return lang and dir attribute
+
+        Must be used on all block elements - div, p, table, etc.
+        @param lang: if defined, will return attributes for lang. if not
+            defined, will return attributes only if the current lang is
+            different from the content lang.
+        @rtype: dict
+        @retrun: language attributes
+        """
+        if not lang:
+            lang = self.request.current_lang
+            # Actions that generate content in user language should change
+            # the content lang from the default defined in cfg.
+            if lang == self.request.content_lang:
+                # lang is inherited from content div
+                return {}
+
+        attr = {'lang': lang, 'dir': i18n.getDirection(lang),}
+        return attr
+
     def lang(self, on, lang_name):
         return ""
 
--- a/MoinMoin/formatter/text_html.py	Thu Jan 26 13:30:03 2006 +0000
+++ b/MoinMoin/formatter/text_html.py	Thu Jan 26 21:57:38 2006 +0000
@@ -49,27 +49,6 @@
     # code clean and handle pathological cases like unclosed p and
     # inline tags.
 
-    def langAttr(self, lang=None):
-        """ Return lang and dir attribute
-
-        Must be used on all block elements - div, p, table, etc.
-        @param lang: if defined, will return attributes for lang. if not
-            defined, will return attributes only if the current lang is
-            different from the content lang.
-        @rtype: dict
-        @retrun: language attributes
-        """
-        if not lang:
-            lang = self.request.current_lang
-            # Actions that generate content in user language should change
-            # the content lang from the default defined in cfg.
-            if lang == self.request.content_lang:
-                # lang is inherited from content div
-                return {}
-
-        attr = {'lang': lang, 'dir': i18n.getDirection(lang),}
-        return attr
-
     def formatAttributes(self, attr=None):
         """ Return formatted attributes string