call site 2 for xml.escape.__call__
apigen/source/testing/test_html.py - line 94
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
   def test_add_row(self):
       doc = HTMLDocument('ascii')
       doc.add_row(1, ['""" this is a foo implementation """'])
       doc.add_row(2, [''])
       doc.add_row(3, ['class ', html.a('Foo', name='Foo'), ':'])
       doc.add_row(4, ['    pass'])
       tbody = doc.tbody
       assert len(tbody) == 4
       assert unicode(tbody[0][0]) == '<td class="lineno">1</td>'
       assert unicode(tbody[0][1]) == ('<td class="code">'
                                       '<span class="string">'
                                       '&quot;&quot;&quot; '
                                       'this is a foo implementation '
                                       '&quot;&quot;&quot;'
                                       '</span></td>')
->     assert unicode(tbody[1][1]) == '<td class="code">&#xa0;</td>'
       assert unicode(tbody[2][1]) == ('<td class="code">'
                                       '<span class="alt_keyword">class'
                                       '</span> '
                                       '<a name="Foo">Foo</a>:</td>')
       assert unicode(tbody[3][1]) == ('<td class="code">    '
                                       '<span class="alt_keyword">pass'
                                       '</span></td>')
xmlobj/xml.py - line 15
14
15
   def __unicode__(self):
->     return self.unicode(indent=0) 
xmlobj/html.py - line 34
32
33
34
35
   def unicode(self, indent=2):
       l = []
->     HtmlVisitor(l.append, indent, shortempty=False).visit(self) 
       return u"".join(l) 
xmlobj/visit.py - line 31
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   def visit(self, node): 
       """ dispatcher on node's class/bases name. """
       cls = node.__class__
       try:
           visitmethod = self.cache[cls]   
       except KeyError:
           for subclass in cls.__mro__: 
               visitmethod = getattr(self, subclass.__name__, None)
               if visitmethod is not None:
                   break
           else:
               visitmethod = self.object 
           self.cache[cls] = visitmethod
->     visitmethod(node) 
xmlobj/visit.py - line 57
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
   def Tag(self, tag):
       assert id(tag) not in self.visited
       try: 
           tag.parent = self.parents[-1]
       except IndexError: 
           tag.parent = None 
       self.visited[id(tag)] = 1
       tagname = getattr(tag, 'xmlname', tag.__class__.__name__)
       if self.curindent and not self._isinline(tagname):
           self.write("\n" + u' ' * self.curindent) 
       if tag:
           self.curindent += self.indent 
->         self.write(u'<%s%s>' % (tagname, self.attributes(tag)))
           self.parents.append(tag) 
           map(self.visit, tag)
           self.parents.pop() 
           self.write(u'</%s>' % tagname) 
           self.curindent -= self.indent 
       else:
           nameattr = tagname+self.attributes(tag) 
           if self._issingleton(tagname): 
               self.write(u'<%s/>' % (nameattr,))
           else: 
               self.write(u'<%s></%s>' % (nameattr, tagname))
xmlobj/visit.py - line 76
70
71
72
73
74
75
76
77
78
79
80
   def attributes(self, tag):
       # serialize attributes
       attrlist = dir(tag.attr) 
       attrlist.sort() 
       l = []
       for name in attrlist: 
->         res = self.repr_attribute(tag.attr, name)
           if res is not None: 
               l.append(res) 
       l.extend(self.getstyle(tag))
       return u"".join(l)
xmlobj/html.py - line 23
18
19
20
21
22
23
   def repr_attribute(self, attrs, name): 
       if name == 'class_':
           value = getattr(attrs, name) 
           if value is None: 
               return
->     return super(HtmlVisitor, self).repr_attribute(attrs, name) 
xmlobj/visit.py - line 87
82
83
84
85
86
87
   def repr_attribute(self, attrs, name): 
       if name[:2] != '__': 
           value = getattr(attrs, name) 
           if name.endswith('_'): 
               name = name[:-1]
->         return u' %s="%s"' % (name, escape(unicode(value)))