http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10316
Revision: 10316 Author: xqt Date: 2012-06-08 06:48:45 +0000 (Fri, 08 Jun 2012) Log Message: ----------- Define the line_separator. Pages retrieved via API have "\n" whereas pages fetched from screen (mostly) have "\r\n". Interwiki and category separator settings in family files should use multiplied of this. LS is a shortcut alias
Modified Paths: -------------- branches/rewrite/pywikibot/config2.py branches/rewrite/pywikibot/family.py
Modified: branches/rewrite/pywikibot/config2.py =================================================================== --- branches/rewrite/pywikibot/config2.py 2012-06-08 06:36:54 UTC (rev 10315) +++ branches/rewrite/pywikibot/config2.py 2012-06-08 06:48:45 UTC (rev 10316) @@ -499,6 +499,12 @@ # processing. As higher this value this effect will decrease. max_queue_size = 64
+# Define the line separator. Pages retrieved via API have "\n" whereas +# pages fetched from screen (mostly) have "\r\n". Interwiki and category +# separator settings in family files should use multiplied of this. +# LS is a shortcut alias. +line_separatur = LS = u'\n' + # End of configuration section # ============================
Modified: branches/rewrite/pywikibot/family.py =================================================================== --- branches/rewrite/pywikibot/family.py 2012-06-08 06:36:54 UTC (rev 10315) +++ branches/rewrite/pywikibot/family.py 2012-06-08 06:48:45 UTC (rev 10316) @@ -582,7 +582,7 @@ # one-after-another on a single line self.interwiki_on_one_line = [] # String used as separator between interwiki links and the text - self.interwiki_text_separator = '\r\n\r\n' + self.interwiki_text_separator = config.line_separator * 2
# Similar for category self.category_attop = [] @@ -590,7 +590,7 @@ # one-after-another on a single line self.category_on_one_line = [] # String used as separator between category links and the text - self.category_text_separator = '\r\n\r\n' + self.category_text_separator = config.line_separator * 2 # When both at the bottom should categories come after interwikilinks? self.categories_last = []
pywikipedia-svn@lists.wikimedia.org