diff --git a/py/apigen/html.py b/py/apigen/html.py index 3b49d7ca0..6043d7801 100644 --- a/py/apigen/html.py +++ b/py/apigen/html.py @@ -1,5 +1,6 @@ -from py.xml import html +import py +html = py.xml.html # HTML related stuff class H(html): @@ -26,7 +27,9 @@ class H(html): def __init__(self, classname, bases, docstring, sourcelink, properties, methods): header = H.h1('class %s(' % (classname,)) - for name, href in bases: + for i, (name, href) in py.builtin.enumerate(bases): + if i > 0: + header.append(', ') link = name if href is not None: link = H.a(name, href=href) @@ -132,8 +135,6 @@ class H(html): super(H.SourceBlock, self).__init__(lntable, ltable) def add_line(self, lineno, els): - if els == []: - els = [u'\xa0'] self.linenotbody.append(H.tr(H.td(lineno, class_='lineno'))) self.linetbody.append(H.tr(H.td(class_='code', *els))) diff --git a/py/apigen/source/color.py b/py/apigen/source/color.py index eb3013852..ecf3141f3 100644 --- a/py/apigen/source/color.py +++ b/py/apigen/source/color.py @@ -7,11 +7,11 @@ class PythonSchema(object): comment = [('#', '\n'), ('#', '$')] multiline_string = ['"""', "'''"] string = ['"""', "'''", '"', "'"] - # XXX not complete - keyword = ['for', 'if', 'not', 'then', 'else', 'while', 'from', 'import', - 'try', 'except', 'finally', 'raise', 'print', 'exec', 'eval', - 'break', 'in', 'assert', 'None'] - alt_keyword = ['def', 'class', 'return', 'pass', 'yield'] + keyword = ['and', 'break', 'continue', 'elif', 'else', 'except', + 'finally', 'for', 'if', 'in', 'is', 'not', 'or', 'raise', + 'return', 'try', 'while', 'with', 'yield'] + alt_keyword = ['as', 'assert', 'class', 'def', 'del', 'exec', 'from', + 'global', 'import', 'lambda', 'pass', 'print'] class Token(object): data = None diff --git a/py/apigen/style.css b/py/apigen/style.css index debdfd781..71405c748 100644 --- a/py/apigen/style.css +++ b/py/apigen/style.css @@ -41,6 +41,7 @@ ul li { } .lineno { + line-height: 1.4em; text-align: right; color: #555; width: 3em; @@ -50,6 +51,7 @@ ul li { } .code { + line-height: 1.4em; padding-left: 1em; white-space: pre; font-family: monospace, Monaco;