+ ''' % (title, extras or ' ')
- def section(self, title, fgcol, bgcol, contents, width=6,
+ def section(self, title, cls, contents, width=6,
prelude='', marginalia=None, gap=' '):
"""Format a section with a heading."""
if marginalia is None:
- marginalia = '' + ' ' * width + ''
+ marginalia = '' + ' ' * width + ''
result = '''
-
-
-
-%s
- ''' % (bgcol, fgcol, title)
+
+
+
%s
+ ''' % (cls, title)
if prelude:
result = result + '''
-
%s
-
%s
-
%s
''' % (bgcol, marginalia, prelude, gap)
+
%s
+
%s
+
%s
''' % (cls, marginalia, cls, prelude, gap)
else:
result = result + '''
-
%s
%s
''' % (bgcol, marginalia, gap)
+
%s
%s
''' % (cls, marginalia, gap)
- return result + '\n
%s
' % contents
+ return result + '\n
%s
' % contents
def bigsection(self, title, *args):
"""Format a section with a big heading."""
- title = '%s' % title
+ title = '%s' % title
return self.section(title, *args)
def preformat(self, text):
@@ -618,19 +617,19 @@ class HTMLDoc(Doc):
return replace(text, '\n\n', '\n \n', '\n\n', '\n \n',
' ', ' ', '\n', ' \n')
- def multicolumn(self, list, format, cols=4):
+ def multicolumn(self, list, format):
"""Format a list of items into a multi-column list."""
result = ''
- rows = (len(list)+cols-1)//cols
- for col in range(cols):
- result = result + '
' % (100//cols)
+ rows = (len(list) + 3) // 4
+ for col in range(4):
+ result = result + '
'
for i in range(rows*col, rows*col+rows):
if i < len(list):
result = result + format(list[i]) + ' \n'
result = result + '
'
- return '
%s
' % result
+ return '
%s
' % result
- def grey(self, text): return '%s' % text
+ def grey(self, text): return '%s' % text
def namelink(self, name, *dicts):
"""Make a link for an identifier, given name-to-URL mappings."""
@@ -719,14 +718,14 @@ class HTMLDoc(Doc):
for entry in tree:
if type(entry) is type(()):
c, bases = entry
- result = result + '
'
+ result = result + '
'
result = result + self.classlink(c, modname)
if bases and bases != (parent,):
parents = []
for base in bases:
parents.append(self.classlink(base, modname))
result = result + '(' + ', '.join(parents) + ')'
- result = result + '\n
'
+ result = result + '\n'
elif type(entry) is type([]):
result = result + '
\n%s
\n' % self.formattree(
entry, modname, c)
@@ -743,10 +742,10 @@ class HTMLDoc(Doc):
links = []
for i in range(len(parts)-1):
links.append(
- '%s' %
+ '%s' %
('.'.join(parts[:i+1]), parts[i]))
linkedname = '.'.join(links + parts[-1:])
- head = '%s' % linkedname
+ head = '%s' % linkedname
try:
path = inspect.getabsfile(object)
url = urllib.parse.quote(path)
@@ -768,9 +767,7 @@ class HTMLDoc(Doc):
docloc = ' Module Reference' % locals()
else:
docloc = ''
- result = self.heading(
- head, '#ffffff', '#7799ee',
- 'index ' + filelink + docloc)
+ result = self.heading(head, 'index ' + filelink + docloc)
modules = inspect.getmembers(object, inspect.ismodule)
@@ -805,7 +802,7 @@ class HTMLDoc(Doc):
data.append((key, value))
doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
- doc = doc and '%s' % doc
+ doc = doc and '%s' % doc
result = result + '
%s
\n' % doc
if hasattr(object, '__path__'):
@@ -815,12 +812,12 @@ class HTMLDoc(Doc):
modpkgs.sort()
contents = self.multicolumn(modpkgs, self.modpkglink)
result = result + self.bigsection(
- 'Package Contents', '#ffffff', '#aa55cc', contents)
+ 'Package Contents', 'pkg-content', contents)
elif modules:
contents = self.multicolumn(
modules, lambda t: self.modulelink(t[1]))
result = result + self.bigsection(
- 'Modules', '#ffffff', '#aa55cc', contents)
+ 'Modules', 'pkg-content', contents)
if classes:
classlist = [value for (key, value) in classes]
@@ -829,27 +826,25 @@ class HTMLDoc(Doc):
for key, value in classes:
contents.append(self.document(value, key, name, fdict, cdict))
result = result + self.bigsection(
- 'Classes', '#ffffff', '#ee77aa', ' '.join(contents))
+ 'Classes', 'index', ' '.join(contents))
if funcs:
contents = []
for key, value in funcs:
contents.append(self.document(value, key, name, fdict, cdict))
result = result + self.bigsection(
- 'Functions', '#ffffff', '#eeaa77', ' '.join(contents))
+ 'Functions', 'functions', ' '.join(contents))
if data:
contents = []
for key, value in data:
contents.append(self.document(value, key))
result = result + self.bigsection(
- 'Data', '#ffffff', '#55aa55', ' \n'.join(contents))
+ 'Data', 'data', ' \n'.join(contents))
if hasattr(object, '__author__'):
contents = self.markup(str(object.__author__), self.preformat)
- result = result + self.bigsection(
- 'Author', '#ffffff', '#7799ee', contents)
+ result = result + self.bigsection('Author', 'author', contents)
if hasattr(object, '__credits__'):
contents = self.markup(str(object.__credits__), self.preformat)
- result = result + self.bigsection(
- 'Credits', '#ffffff', '#7799ee', contents)
+ result = result + self.bigsection('Credits', 'credits', contents)
return result
@@ -923,7 +918,7 @@ class HTMLDoc(Doc):
else:
doc = self.markup(getdoc(value), self.preformat,
funcs, classes, mdict)
- doc = '
%s' % doc
+ doc = '
%s' % doc
push('
%s%s
\n' % (base, doc))
push('\n')
return attrs
@@ -1011,9 +1006,9 @@ class HTMLDoc(Doc):
if decl:
doc = decl + (doc or '')
doc = self.markup(doc, self.preformat, funcs, classes, mdict)
- doc = doc and '%s ' % doc
+ doc = doc and '%s ' % doc
- return self.section(title, '#000000', '#ffc8d8', contents, 3, doc)
+ return self.section(title, 'title', contents, 3, doc)
def formatvalue(self, object):
"""Format an argument default value as text."""
@@ -1074,14 +1069,14 @@ class HTMLDoc(Doc):
argspec = '(...)'
decl = asyncqualifier + title + self.escape(argspec) + (note and
- self.grey('%s' % note))
+ self.grey('%s' % note))
if skipdocs:
return '
+ Data descriptors defined here:
+ __dict__
+ dictionary for instance variables (if defined)
+ __weakref__
+ list of weak references to the object (if defined)
-
+class B(builtins.object)
+ Data descriptors defined here:
+ __dict__
+ dictionary for instance variables (if defined)
+ __weakref__
+ list of weak references to the object (if defined)
+ Data and other attributes defined here:
+ NO_MEANING = 'eggs'
+ __annotations__ = {'NO_MEANING': }
-
-Data descriptors defined here:
-
__dict__
-
dictionary for instance variables (if defined)
-
-
__weakref__
-
list of weak references to the object (if defined)