12
12
no_comments = False
13
13
except ImportError :
14
14
class LexicalHandler :
15
- def __init__ (self ):
16
- pass
15
+ pass
17
16
no_comments = True
18
17
19
18
@@ -22,18 +21,18 @@ def __init__(self, attrlist):
22
21
self .isPointsElement , self .isReboundsElement = 0 , 0
23
22
self .attrlist = attrlist
24
23
self .last_comment = None
25
- self .ishex = re .compile ('#[0-9a-fA-F]+\Z' )
24
+ self .ishex = re .compile (r '#[0-9a-fA-F]+\Z' )
26
25
27
26
def comment (self , comment ):
28
27
if "TRANSLATORS:" in comment :
29
28
self .last_comment = comment
30
29
31
30
def startElement (self , name , attrs ):
32
- for x in ["text" , "title" , "value" , "caption" , "description" ]:
31
+ for x in ["text" , "title" , "value" , "caption" , "summary" , " description" ]:
33
32
try :
34
33
k = six .ensure_str (attrs [x ])
35
34
if k .strip () != "" and not self .ishex .match (k ):
36
- attrlist .add ((k , self .last_comment ))
35
+ attrlist .add ((attrs [ x ] , self .last_comment ))
37
36
self .last_comment = None
38
37
except KeyError :
39
38
pass
@@ -51,7 +50,7 @@ def startElement(self, name, attrs):
51
50
for arg in sys .argv [1 :]:
52
51
if os .path .isdir (arg ):
53
52
for file in os .listdir (arg ):
54
- if file .endswith (".xml" ):
53
+ if ( file .endswith (".xml" ) ):
55
54
parser .parse (os .path .join (arg , file ))
56
55
else :
57
56
parser .parse (arg )
0 commit comments