Take account of new "good things" reported by libdcp verifier.
authorCarl Hetherington <cth@carlh.net>
Tue, 26 Nov 2024 21:07:26 +0000 (22:07 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 7 Dec 2024 20:36:21 +0000 (21:36 +0100)
cscript
doc/manual/.gitignore
doc/manual/Makefile
doc/manual/dcpomatic.xml
doc/manual/verifier.py

diff --git a/cscript b/cscript
index acb29f1803927d70593069636305a6dafae5d744..7be04915e349d1ef34398d7849aee0f8664c5b9f 100644 (file)
--- a/cscript
+++ b/cscript
@@ -531,7 +531,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
 
 def dependencies(target, options):
-    deps = [('libdcp', 'v1.9.24', {'c++17': target.platform.startswith('osx')})]
+    deps = [('libdcp', 'v1.9.25', {'c++17': target.platform.startswith('osx')})]
     deps.append(('libsub', 'v1.6.52'))
     deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
     deps.append(('rtaudio', 'f619b76'))
index bc9331596f7d37e8cf35b58bab3d307f3edb98c2..c4decec052e8bb47081930af48e0f2620f6fae29 100644 (file)
@@ -2,3 +2,5 @@ screenshots/*.pdf
 verify_bv21_errors.xml
 verify_errors.xml
 verify_warnings.xml
+verify_ok.xml
+
index 03f3db87e10dbb05b34f138e0cdabe0cd296bfce..ab8a7f398c6e61fe7cfb71f55d000846ab2d1bf0 100644 (file)
@@ -118,12 +118,14 @@ verify_bv21_errors.xml:   verifier.py $(LIBDCP_DEPS)
 verify_warnings.xml:   verifier.py $(LIBDCP_DEPS)
        python3 verifier.py $(LIBDCP) WARNING > $@
 
+verify_ok.xml: verifier.py $(LIBDCP_DEPS)
+       python3 verifier.py $(LIBDCP) OK > $@
 
 #
 # HTML
 #
 
-html:  $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
+html:  $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml verify_ok.xml \
        dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
        $(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \
        $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
@@ -144,7 +146,7 @@ html:       $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml v
 # PDF
 #
 
-pdf:   $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
+pdf:   $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml verify_ok.xml \
        dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
        $(addprefix screenshots/,$(SCREENSHOTS)) \
        $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
index 9608d7bc2105a66cb5ba8950f1a09b24be4c1636..df4bc75f51f15029c4755e8bfed069756b739559 100644 (file)
@@ -3934,6 +3934,10 @@ are changed.
   <listitem><emphasis>Warnings</emphasis> &mdash; small problems that may not matter.</listitem>
   </itemizedlist>
 
+  <para>
+    It will also report some &lsquo;good&rsquo; things, which have been checked and found to be in order.
+  </para>
+
   <para>
     The following sections list what the verifier checks for in each category.
   </para>
@@ -3953,6 +3957,11 @@ are changed.
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="verify_warnings.xml"/>
   </section>
 
+  <section>
+  <title>Good things</title>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="verify_ok.xml"/>
+  </section>
+
 </chapter>
 
 
index 877a118a1d6236820c97dfa990daf66f171f7e2a..f39a00e2e45604b25069f763889b58101f43a802 100644 (file)
@@ -1,4 +1,7 @@
 #!/usr/bin/python3
+#
+# Return DocBook markup for all the verification warnings/errors/"ok" notes of a given
+# type in verify.h
 
 from pathlib import Path
 import re
@@ -6,32 +9,39 @@ import sys
 import subprocess
 
 if len(sys.argv) < 3:
-    print(f"Syntax: {sys.argv[0]} <path-to-libdcp-source-tree> <ERROR|BV21_ERROR|WARNING>")
+    print(f"Syntax: {sys.argv[0]} <path-to-libdcp-source-tree> <ERROR|BV21_ERROR|WARNING|OK>")
     sys.exit(1)
 
 libdcp = Path(sys.argv[1])
 type = sys.argv[2]
 header = libdcp / "src" / "verify.h"
 
-types = ("BV21_ERROR", "ERROR", "WARNING")
+# The types of note we have, and the strings to look for in order to recognise them
+types = {
+    "BV21_ERROR": ("BV21_ERROR", "bv21_error("),
+    "ERROR": ("ERROR", "error("),
+    "WARNING": ("WARNING", "warning("),
+    "OK": ("ok(",),
+}
 
 def find_type(name):
     """
     Search source code to find where a given code is used and hence find out whether
-    it represents an error, Bv2.1 "error" or warning.
+    it represents an error, Bv2.1 "error", warning or "this is OK" note.
     """
     previous = ''
-    for source in ["verify_j2k.cc", "dcp.cc", "verify.cc"]:
+    for source in ["verify_j2k.cc", "dcp.cc", "verify.cc", "cpl.cc"]:
         path = libdcp / "src" / source
         with open(path) as s:
             for line in s:
                 if line.find(name) != -1:
                     line_with_previous = previous + line
-                    for t in types:
-                        if line_with_previous.find(t) != -1:
-                            return t
-                    assert False
+                    for type, signatures in types.items():
+                        for s in signatures:
+                            if line_with_previous.find(s) != -1:
+                                return type
                 previous = line
+    assert False
 
 
 print('<itemizedlist>')
@@ -49,6 +59,7 @@ with open(header) as h:
                 text = strip.replace('/**', '').replace('*/', '').strip()
             elif not strip.startswith('/*') and not strip.startswith('*') and strip.endswith(','):
                 this_type = find_type(strip[:-1])
+                # print("find", strip[:-1], this_type)
                 if this_type == type:
                     text = re.sub(r"\[.*?\]", lambda m: f'(Bv2.1 {m[0][7:-1]})', text)
                     text = text.replace('<', '&lt;')