| | 72 | class TitleSlide(Slide): |
| | 73 | def toHTML(self): |
| | 74 | title = '<h1>%s</h1>' % cgi.escape(self.title) |
| | 75 | bullets = [] |
| | 76 | for bullet in self.bullets: |
| | 77 | bullets.append(bullet.toHTML()) |
| | 78 | return "<div style='margin: auto; width: 50%;'>" + title + self.start + "\n".join(bullets) + self.end + "</div>" |
| | 79 | |
| | 80 | class BulletlessSlide(Slide): |
| | 81 | start = "<ul style='list-style-type: none;'>\n" |
| | 82 | end = "</ul>\n" |
| | 83 | |
| | 84 | class BulletlessTitleSlide(TitleSlide): |
| | 85 | start = "<ul style='list-style-type: none;'>\n" |
| | 86 | end = "</ul>\n" |
| | 87 | |
| | 88 | class URL(object): |
| | 89 | """A URL.""" |
| | 90 | def __init__(self, desc, url): |
| | 91 | self.url = url |
| | 92 | self.desc = desc |
| | 93 | |
| | 94 | def toHTML(self): |
| | 95 | return '<a href="%s">%s</a>' % (self.url, self.desc) |
| | 96 | |
| | 130 | Bullet("Adding slots:", PYCON(""" |
| | 131 | >>> class FooBar(object): |
| | 132 | ... def __str__(self): |
| | 133 | ... return "foobar" |
| | 134 | ... |
| | 135 | >>> def __unicode__(self): |
| | 136 | ... return unicode("foobar") |
| | 137 | ... |
| | 138 | >>> str(FuBar), str(FuBar()) |
| | 139 | ("<class 'util.FuBar'>", 'fubar') |
| | 140 | >>> unicode(FuBar) |
| | 141 | Traceback (most recent call last): |
| | 142 | File "<stdin>", line 1, in <module> |
| | 143 | TypeError: unbound method __unicode__() must be called with FuBar instance as first argument (got nothing instead) |
| | 144 | >>> unicode(Uni()) |
| | 145 | u'fubar' |
| | 146 | """)), |
| | 147 | Bullet("Same thing happens with old-style classes.") |
| | 148 | ), |
| | 149 | BulletlessSlide("object.c", |
| | 150 | Bullet(Image("tabs.png")), |
| 186 | | Slide("PyObject C API", |
| 187 | | Bullet("List of methods unchanged between 2.5 and 2.6"), |
| 188 | | ), |
| 189 | | Slide("object.c", |
| 190 | | Bullet(Image("tabs.png")), |
| 191 | | ), |
| 192 | | Slide("New Python Documents - ZOMG!", |
| 193 | | Bullet("Interactive search -- in static HTML."), |
| 194 | | Bullet("_static/searchindex.json"), |
| 195 | | Bullet(URL("file:///home/simon/LocalProjects/PythonSpint/trunk/Doc/build/html/index.html")), |
| | 243 | Slide("C API Documentation", |
| | 244 | Bullet("PyObject API:", |
| | 245 | SubBullet( |
| | 246 | Bullet("List of methods unchanged between 2.5, 2.6 and 3.0"), |
| | 247 | ), |
| | 248 | ), |
| | 249 | Bullet("New documentation!", |
| | 250 | SubBullet( |
| | 251 | Bullet("Interactive search -- in static HTML"), |
| | 252 | Bullet("JSON index"), |
| | 253 | Bullet(URL("2.6 Docs","file:///home/simon/LocalProjects/PythonSpint/trunk/Doc/build/html/index.html")), |
| | 254 | ), |
| | 255 | ), |