[py-svn] r38213 - py/trunk/py/apigen

guido at codespeak.net guido at codespeak.net
Thu Feb 8 23:19:13 CET 2007


Author: guido
Date: Thu Feb  8 23:19:10 2007
New Revision: 38213

Modified:
   py/trunk/py/apigen/html.py
   py/trunk/py/apigen/htmlgen.py
   py/trunk/py/apigen/style.css
Log:
Some small cleanups, made fonts a bit smaller and more consistent.


Modified: py/trunk/py/apigen/html.py
==============================================================================
--- py/trunk/py/apigen/html.py	(original)
+++ py/trunk/py/apigen/html.py	Thu Feb  8 23:19:10 2007
@@ -112,12 +112,13 @@
             super(H.SourceSnippet, self).__init__(
                 link, H.div(*sourceels))
     
-    class SourceDef(html.div):
+    class PythonSource(Content):
+        style = html.Style(font_size='0.8em')
         def __init__(self, *sourceels):
-            super(H.SourceDef, self).__init__(
+            super(H.PythonSource, self).__init__(
                 H.div(*sourceels))
 
-    class SourceCode(html.div):
+    class SourceBlock(html.div):
         style = html.Style(margin_top='1em', margin_bottom='1em')
         def __init__(self):
             self.linenotable = lntable = H.table(style='float: left')
@@ -128,7 +129,7 @@
             self.linetbody = ltbody = H.tbody()
             ltable.append(ltbody)
             
-            super(H.SourceCode, self).__init__(lntable, ltable)
+            super(H.SourceBlock, self).__init__(lntable, ltable)
 
         def add_line(self, lineno, els):
             if els == []:
@@ -136,10 +137,11 @@
             self.linenotbody.append(H.tr(H.td(lineno, class_='lineno')))
             self.linetbody.append(H.tr(H.td(class_='code', *els)))
 
-    class NonPythonSource(html.pre):
-        pass # style = html.Style(margin_left='15em')
+    class NonPythonSource(Content):
+        def __init__(self, *args):
+            super(H.NonPythonSource, self).__init__(H.pre(*args))
 
-    class DirList(html.div):
+    class DirList(Content):
         def __init__(self, dirs, files):
             dirs = [H.DirListItem(text, href) for (text, href) in dirs]
             files = [H.DirListItem(text, href) for (text, href) in files]

Modified: py/trunk/py/apigen/htmlgen.py
==============================================================================
--- py/trunk/py/apigen/htmlgen.py	(original)
+++ py/trunk/py/apigen/htmlgen.py	Thu Feb  8 23:19:10 2007
@@ -124,7 +124,7 @@
     return page
 
 def enumerate_and_color(codelines, firstlineno, enc):
-    snippet = H.SourceCode()
+    snippet = H.SourceBlock()
     tokenizer = source_color.Tokenizer(source_color.PythonSchema)
     for i, line in enumerate(codelines):
         try:
@@ -230,7 +230,7 @@
         source = fspath.read()
         sep = get_linesep(source)
         colored = enumerate_and_color(source.split(sep), 0, enc)
-        tag = H.SourceDef(colored)
+        tag = H.PythonSource(colored)
         nav = self.build_navigation(fspath)
         return tag, nav
 
@@ -597,7 +597,7 @@
         return cslinks
 
     def build_callsite(self, dotted_name, call_site, index):
-        tbtag = self.gen_traceback(dotted_name, reversed(call_site))
+        tbtag = H.Content(self.gen_traceback(dotted_name, reversed(call_site)))
         parent_dotted_name, _ = split_of_last_part(dotted_name)
         nav = self.build_navigation(parent_dotted_name, False)
         id = 'callsite_%s_%s' % (dotted_name, index)

Modified: py/trunk/py/apigen/style.css
==============================================================================
--- py/trunk/py/apigen/style.css	(original)
+++ py/trunk/py/apigen/style.css	Thu Feb  8 23:19:10 2007
@@ -80,10 +80,6 @@
   background-color: white;
 }
 
-.property {
-  font-size: 1.2em;
-}
-
 .callstackitem {
   border: 1px solid black;
   margin-bottom: 1em;



More information about the pytest-commit mailing list