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 8
8
"""
9
9
10
10
import pathlib
11
- import tempfile
12
- import sys
13
11
import subprocess
12
+ import sys
13
+ import tempfile
14
14
import xml .sax
15
15
16
-
17
16
include_cache = {}
18
17
18
+
19
19
class IncludeHandler (xml .sax .ContentHandler ):
20
20
def __init__ (self , xml ):
21
+ super ().__init__ ()
21
22
self .__xml = xml
22
23
23
24
def startElement (self , name , attrs ):
24
25
if name == "include" :
25
26
src = (self .__xml .parent / attrs ["src" ]).resolve ()
26
27
include_cache .setdefault (src , set ()).add (self .__xml )
27
28
29
+
28
30
class IgnoreErrorsHandler (xml .sax .ErrorHandler ):
29
31
def error (self , exc ):
30
32
pass
@@ -35,6 +37,7 @@ def fatalError(self, exc):
35
37
def warning (self , exc ):
36
38
pass
37
39
40
+
38
41
def init_include_cache ():
39
42
if not include_cache :
40
43
for qhelp in pathlib .Path ().rglob ("*.qhelp" ):
@@ -45,6 +48,7 @@ def find_inc_qhelp_usages(arg):
45
48
init_include_cache ()
46
49
return include_cache .get (arg .resolve (), ())
47
50
51
+
48
52
def transform_inputs (args ):
49
53
for arg in args :
50
54
arg = pathlib .Path (arg )
@@ -54,6 +58,7 @@ def transform_inputs(args):
54
58
else :
55
59
yield str (arg )
56
60
61
+
57
62
affected_qhelp_files = list (transform_inputs (sys .argv [1 :]))
58
63
if not affected_qhelp_files :
59
64
# can happen with changes on an unused .inc.qhelp file
You can’t perform that action at this time.
0 commit comments