mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 02:49:46 +00:00
Double escape binary regex in lyx2lyx and fix line-ending problem.
When we switched from r'...' to b'...', this required strings used
as input to re.compile to be double-escaped. It's not an issue with
"\s", because "\s" has no special meaning in a string.
Also, printing in binary mode did not output a line ending.
(cherry picked from commit 6b5a7116cd
)
This commit is contained in:
parent
4fc0f3e754
commit
42718b1dbd
@ -1285,8 +1285,8 @@ def processLayoutFile(file, bool_docbook):
|
|||||||
return x.strip()
|
return x.strip()
|
||||||
classname = file.split(os.sep)[-1].split('.')[0]
|
classname = file.split(os.sep)[-1].split('.')[0]
|
||||||
# return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclareLaTeXClass[a,b,c]{article}
|
# return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclareLaTeXClass[a,b,c]{article}
|
||||||
p = re.compile(b'^\s*#\s*\\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}\s*$')
|
p = re.compile(b'^\s*#\s*\\\\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}\s*$')
|
||||||
q = re.compile(b'^\s*#\s*\\DeclareCategory{(.*)}\s*$')
|
q = re.compile(b'^\s*#\s*\\\\DeclareCategory{(.*)}\s*$')
|
||||||
classdeclaration = b""
|
classdeclaration = b""
|
||||||
categorydeclaration = b'""'
|
categorydeclaration = b'""'
|
||||||
for line in open(file, 'rb').readlines():
|
for line in open(file, 'rb').readlines():
|
||||||
@ -1359,7 +1359,7 @@ def checkLatexConfig(check_config, bool_docbook):
|
|||||||
foundClasses.append(cleanclass)
|
foundClasses.append(cleanclass)
|
||||||
retval = processLayoutFile(file, bool_docbook)
|
retval = processLayoutFile(file, bool_docbook)
|
||||||
if retval != b"":
|
if retval != b"":
|
||||||
tx.write(retval)
|
tx.write(retval + os.linesep)
|
||||||
tx.close()
|
tx.close()
|
||||||
logger.info('\tdone')
|
logger.info('\tdone')
|
||||||
if not os.path.isfile('packages.lst') or not check_config:
|
if not os.path.isfile('packages.lst') or not check_config:
|
||||||
|
Loading…
Reference in New Issue
Block a user