Revision: 6936 Author: cosoleto Date: 2009-06-03 13:45:50 +0000 (Wed, 03 Jun 2009)
Log Message: ----------- Use the rstrip() string method instead of a while loop.
Modified Paths: -------------- trunk/pywikipedia/xmlreader.py
Modified: trunk/pywikipedia/xmlreader.py =================================================================== --- trunk/pywikipedia/xmlreader.py 2009-06-02 19:35:07 UTC (rev 6935) +++ trunk/pywikipedia/xmlreader.py 2009-06-03 13:45:50 UTC (rev 6936) @@ -161,10 +161,8 @@ self.editRestriction, self.moveRestriction = parseRestrictions(self.restrictions) elif name == 'revision': # All done for this. - text = self.text # Remove trailing newlines and spaces - while text and text[-1] in '\n ': - text = text[:-1] + text = self.text.rstrip('\n ') # Replace newline by cr/nl text = u'\r\n'.join(text.split('\n')) # Decode the timestamp
pywikipedia-svn@lists.wikimedia.org