[LyX features/feature/docbook] DocBook: in configure.py, DeclareDocBookClass doesn't need to be checked anymore.

Thibaut Cuvelier tcuvelier at lyx.org
Fri Sep 11 00:38:27 UTC 2020


The branch, feature/docbook, has been updated.
  discards  d4101fc1960a8ab185913762e8995709881abac0 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (d4101fc1960a8ab185913762e8995709881abac0)
            \
             N -- N -- N (d97b9ebd03d75f0bb8c6a207f1078b32cfd39a2b)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

- Log -----------------------------------------------------------------

commit d97b9ebd03d75f0bb8c6a207f1078b32cfd39a2b
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Fri Sep 11 03:05:04 2020 +0200

    DocBook: in configure.py, DeclareDocBookClass doesn't need to be checked anymore.

diff --git a/lib/configure.py b/lib/configure.py
index 2247c78..95e9540 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1339,7 +1339,7 @@ def processLayoutFile(file):
     '''
     classname = file.split(os.sep)[-1].split('.')[0]
     # return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclareLaTeXClass[a,b,c]{article}
-    p = re.compile('\s*#\s*\\\\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}\s*$')
+    p = re.compile('\s*#\s*\\\\DeclareLaTeXClass\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}\s*$')
     q = re.compile('\s*#\s*\\\\DeclareCategory{(.*)}\s*$')
     classdeclaration = ""
     categorydeclaration = '""'
@@ -1347,7 +1347,8 @@ def processLayoutFile(file):
         res = p.match(line)
         qres = q.match(line)
         if res != None:
-            (classtype, optAll, opt, opt1, desc) = res.groups()
+            (optAll, opt, opt1, desc) = res.groups()
+            classtype = "LaTeX"
             avai = {'LaTeX': 'false', 'DocBook': 'true'}[classtype]
             if opt == None:
                 opt = classname
@@ -1434,7 +1435,7 @@ def checkLatexConfig(check_config):
     # Construct the list of classes to test for.
     # build the list of available layout files and convert it to commands
     # for chkconfig.ltx
-    declare = re.compile('\\s*#\\s*\\\\Declare(LaTeX|DocBook)Class\\s*(\[([^,]*)(,.*)*\])*\\s*{(.*)}\\s*$')
+    declare = re.compile('\\s*#\\s*\\\\DeclareDocBookClass\\s*(\[([^,]*)(,.*)*\])*\\s*{(.*)}\\s*$')
     category = re.compile('\\s*#\\s*\\\\DeclareCategory{(.*)}\\s*$')
     empty = re.compile('\\s*$')
     testclasses = list()
@@ -1455,10 +1456,10 @@ def checkLatexConfig(check_config):
                         nodeclaration = True
                     # A class, but no category declaration. Just break.
                     break
-                if declare.match(line) != None:
+                if declare.match(line) is not None:
                     decline = "\\TestDocClass{%s}{%s}" % (classname, line[1:].strip())
                     testclasses.append(decline)
-                elif category.match(line) != None:
+                elif category.match(line) is not None:
                     catline = ("\\DeclareCategory{%s}{%s}"
                                % (classname, category.match(line).groups()[0]))
                     testclasses.append(catline)

-----------------------------------------------------------------------

Summary of changes:
 lib/configure.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Repository for new features


More information about the lyx-cvs mailing list