File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 88"""
99
1010import pathlib
11- import tempfile
12- import sys
1311import subprocess
12+ import sys
13+ import tempfile
1414import xml .sax
1515
16-
1716include_cache = {}
1817
18+
1919class IncludeHandler (xml .sax .ContentHandler ):
2020 def __init__ (self , xml ):
21+ super ().__init__ ()
2122 self .__xml = xml
2223
2324 def startElement (self , name , attrs ):
2425 if name == "include" :
2526 src = (self .__xml .parent / attrs ["src" ]).resolve ()
2627 include_cache .setdefault (src , set ()).add (self .__xml )
2728
29+
2830class IgnoreErrorsHandler (xml .sax .ErrorHandler ):
2931 def error (self , exc ):
3032 pass
@@ -35,6 +37,7 @@ def fatalError(self, exc):
3537 def warning (self , exc ):
3638 pass
3739
40+
3841def init_include_cache ():
3942 if not include_cache :
4043 for qhelp in pathlib .Path ().rglob ("*.qhelp" ):
@@ -45,6 +48,7 @@ def find_inc_qhelp_usages(arg):
4548 init_include_cache ()
4649 return include_cache .get (arg .resolve (), ())
4750
51+
4852def transform_inputs (args ):
4953 for arg in args :
5054 arg = pathlib .Path (arg )
@@ -54,6 +58,7 @@ def transform_inputs(args):
5458 else :
5559 yield str (arg )
5660
61+
5762affected_qhelp_files = list (transform_inputs (sys .argv [1 :]))
5863if not affected_qhelp_files :
5964 # can happen with changes on an unused .inc.qhelp file
You can’t perform that action at this time.
0 commit comments