[rkward-cvs] [rkward] scripts: Simplify

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Dec 8 18:57:18 UTC 2014


Git commit 4f8e2ba0ae14931e05f27942c912c404e80ee39d by Thomas Friedrichsmeier.
Committed on 08/12/2014 at 11:39.
Pushed by tfry into branch 'master'.

Simplify

M  +3    -5    scripts/update_plugin_messages.py

http://commits.kde.org/rkward/4f8e2ba0ae14931e05f27942c912c404e80ee39d

diff --git a/scripts/update_plugin_messages.py b/scripts/update_plugin_messages.py
index cfb7e2b..f74d77d 100755
--- a/scripts/update_plugin_messages.py
+++ b/scripts/update_plugin_messages.py
@@ -91,15 +91,13 @@ if (len (toplevel_sources) < 1):
 # The second thing we do is hacking line number information into the parsed XML tree
 def parseFile (filename):
   f = codecs.open (filename, 'r', 'utf-8')
-  content = f.read ().replace ("&", "&").split ("\n")
-  f.close ()
-
   l = 0
   enriched = list ()
-  for line in content:
+  for line in f:
     l += 1
     enriched.append (re.sub (r'<(\w+)', r'<\1 ' + LINE_DUMMY_ATTR + '="' + str (l) + '"', line))
-  content = "\n".join (enriched)
+  content = "".join (enriched).replace ("&", "&")
+  f.close ()
 
   try:
     return minidom.parseString (content)





More information about the rkward-tracker mailing list