summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-07 19:26:51 +0200
committerBruno Haible <bruno@clisp.org>2022-08-07 23:04:23 +0200
commit9b2a7c800a82de247a92d43c10cc926fdcc11031 (patch)
tree4eb2dcb3a35575669c1418d51c5000f3a9c1535a /pygnulib
parent8341b4a206b8f1f6ec14966292afb5134de2a4c2 (diff)
downloadgnulib-9b2a7c800a82de247a92d43c10cc926fdcc11031.tar.gz
gnulib-tool.py: Simplify.
* pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right after reading the module description, not in every accessor.
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLModuleSystem.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 33495f9c07..b736bf2ed1 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -210,7 +210,7 @@ Include:|Link:|License:|Maintainer:)'
self.filesystem = GLFileSystem(self.config)
self.modulesystem = GLModuleSystem(self.config)
with codecs.open(module, 'rb', 'UTF-8') as file:
- self.content = file.read()
+ self.content = file.read().replace('\r\n', '\n')
def __eq__(self, module):
'''x.__eq__(y) <==> x==y'''
@@ -428,7 +428,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -453,7 +452,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -476,7 +474,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -510,7 +507,6 @@ Include:|Link:|License:|Maintainer:)'
result = list()
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -540,7 +536,6 @@ Include:|Link:|License:|Maintainer:)'
depmodules = list()
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -580,7 +575,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -603,7 +597,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -640,7 +633,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -734,7 +726,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()
@@ -759,7 +750,6 @@ Include:|Link:|License:|Maintainer:)'
parts = list()
if section in self.content:
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
for line in lines:
@@ -826,7 +816,6 @@ Include:|Link:|License:|Maintainer:)'
result = ''
else: # if section in self.content
snippet = self.content.split(section)[-1]
- snippet = snippet.replace('\r\n', '\n')
lines = [ '%s\n' % line
for line in snippet.split('\n') ]
parts = list()