[svn r38246] Fixed problems with line height in sources, added missing commas to seperate
base classes, added all Python (2.5) keywords. --HG-- branch : trunk
This commit is contained in:
parent
d2f11081cb
commit
73281adc5a
|
@ -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)))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue