Changeset 356

Show
Ignore:
Timestamp:
06/21/08 23:07:54 (4 years ago)
Author:
simon
Message:

Add copyright notice. Clean up.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hodgestar/Talks/PythonObjects/pyobjects.py

    r349 r356  
    1 from slides import Lecture, Slide, Bullet, PRE, Image, SubBullet, CODE, PYCODE, PYCON, cgi 
     1# pyobjects.py 
     2# -*- coding: utf8 -*- 
     3# Copyright 2008 Simon Cross <hodgestar@gmail.com> 
     4# GPL - see COPYING for details 
    25 
    36""" 
     
    69   depths of Object/object.c. 
    710 
    8 TO INCLUDE: 
    9  
    10 Proxy with new vs old classes: 
    11   http://bugs.python.org/issue643841 
    12  
    13 Slots and __unicode__: 
    14   http://bugs.python.org/issue2517 
    15  
    16 Caching of floats and ints 
    17  
    18 - screenshot of highlighted tabs in object.c 
     11Talk given to the Cape Town Python Users Group on 21 June 2008. 
    1912""" 
    2013 
     14from slides import Lecture, Slide, Bullet, PRE, Image, SubBullet, CODE, PYCODE, PYCON, cgi 
     15 
     16# 
     17# Customisation of Python slides for this talk 
     18# 
     19 
    2120class MyLecture(Lecture): 
     21    """Allow list of CSS files for pygments rendering. 
     22       """ 
    2223    def getHeader(self): 
    2324        """Return the header for HTML pages.""" 
     
    2829        return result + '</head>\n<body>\n' 
    2930 
    30 class MySlide(Slide): 
    31     _Slide = Slide 
     31class CenteredSlide(Slide): 
     32    """Centered slides.""" 
    3233    def toHTML(self): 
    33         html = self._Slide.toHTML(self) 
     34        html = super(CenteredSlide, self).toHTML() 
    3435        return "<div style='margin: auto; width: 50%;'>" + html + "</div>" 
    3536 
    36 Slide = MySlide 
     37Slide = CenteredSlide 
    3738 
    3839class TitleSlide(Slide): 
     40    """Centered title slides.""" 
    3941    def toHTML(self): 
    4042        title = '<h1>%s</h1>' % cgi.escape(self.title) 
     
    4547 
    4648class BulletlessSlide(Slide): 
     49    """Slide without bullets.""" 
    4750    start = "<ul style='list-style-type: none;'>\n" 
    4851    end = "</ul>\n" 
    4952 
    5053class BulletlessTitleSlide(TitleSlide): 
     54    """Title slide without bullets.""" 
    5155    start = "<ul style='list-style-type: none;'>\n" 
    5256    end = "</ul>\n" 
    5357 
    5458class URL(object): 
    55     """A URL.""" 
     59    """A URL with both description and link.""" 
    5660    def __init__(self, desc, url): 
    5761        self.url = url 
     
    6064    def toHTML(self): 
    6165        return '<a href="%s">%s</a>' % (self.url, self.desc) 
     66 
     67# 
     68# PyObjects Talk 
     69# 
    6270 
    6371l = MyLecture(