aboutsummaryrefslogtreecommitdiffstats
path: root/websites
diff options
context:
space:
mode:
authorYuri Chornoivan <yurchor@mageia.org>2012-09-11 16:29:40 +0000
committerYuri Chornoivan <yurchor@mageia.org>2012-09-11 16:29:40 +0000
commit91c142d0f77bdd8830b8c7da4ad44ea164663704 (patch)
tree39c4d6e3c969c4ef2477808f28fd57f172bb5fdf /websites
parent411e16cf9f310844036c729dd4f08f6c79c8929a (diff)
downloadtools-91c142d0f77bdd8830b8c7da4ad44ea164663704.tar
tools-91c142d0f77bdd8830b8c7da4ad44ea164663704.tar.gz
tools-91c142d0f77bdd8830b8c7da4ad44ea164663704.tar.bz2
tools-91c142d0f77bdd8830b8c7da4ad44ea164663704.tar.xz
tools-91c142d0f77bdd8830b8c7da4ad44ea164663704.zip
Remove trailing spaces from lines.
Diffstat (limited to 'websites')
-rw-r--r--websites/translated_converter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/websites/translated_converter.py b/websites/translated_converter.py
index b75b77dc..57116c29 100644
--- a/websites/translated_converter.py
+++ b/websites/translated_converter.py
@@ -38,7 +38,11 @@ for langfile in glob.glob(file_mask):
raise
#open lang file
text = open(langfile,"r").read()
- newtext = text.split('\n\n',1)[0]
+ #Remove trailing spaces from lines
+ spaces=' {1,}\n'
+ spattern=re.compile(spaces,re.DOTALL)
+ for emptyline in spattern.findall(text):
+ text = text.replace(emptyline,'\n')
# Write PO file
po = polib.POFile()