call site 0 for xml.escape.__call__
apigen/source/testing/test_html.py - line 45
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
   def test_basic():
       tmp = py.test.ensuretemp("sourcehtml")
       inp = tmp.ensure("one.py")
       inp.write(py.code.Source("""
       def func_one():
           pass
       
       def func_two(x, y):
           x = 1
           y = 2
           return x + y
       
       class B:
           pass
       
       class A(B):
           def meth1(self):
               pass
           
           def meth2(self):
               pass
       """))
       
->     testfile = create_html_and_show(inp)
       data = testfile.open().read()
       assert data.find('<a href="#func_one"') != -1
       assert data.find('<a href="#func_two"') != -1
       assert data.find('<a href="#B"') != -1
       assert data.find('<a href="#A"') != -1
       assert data.find('<a href="#A.meth1"') != -1
apigen/source/testing/test_html.py - line 17
15
16
17
18
19
20
   def create_html_and_show(path):
       mod = parse_path(path)
->     html = create_html(mod)
       testfile = py.test.ensuretemp("htmloutput").ensure("test.html")
       testfile.write(unicode(html))
       return testfile
apigen/source/html.py - line 170
159
160
161
162
163
164
165
166
167
168
169
170
   def create_html(mod):
       # out is some kind of stream
       #*[html.tr(html.td(i.name)) for i in mod.get_children()]
       lines = mod.path.open().readlines()
       
       enchanter = HtmlEnchanter(mod)
       enc = get_module_encoding(mod.path)
       doc = HTMLDocument(enc)
       for i, row in enumerate(lines):
           row = enchanter.enchant_row(i + 1, row)
           doc.add_row(i + 1, row)
->     return unicode(doc)
apigen/source/html.py - line 157
154
155
156
157
   def __unicode__(self):
       # XXX don't like to use indent=0 here, but else py.xml's indentation
       # messes up the html inside the table cells (which displays formatting)
->     return self.html.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 59
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 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 59
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 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)))