From jh@web.de Tue Apr 1 23:08:31 2003 From: jh@web.de (Juergen Hermann) Date: Wed, 02 Apr 2003 01:08:31 +0200 Subject: [Doc-SIG] Using docutils on source code Message-ID: Hi! Maybe=20I'm=20thick=20here,=20but=20from=20a=20more=20than=20cursory=20loo= k=20at=20the=20docs=20I=20 got=20the=20impression=20that=20docutils=20is=20still=20"just"=20a=20docum= ent=20processor,=20 and=20that=20there=20is=20no=20front-end=20to=20extract=20docstrings=20fro= m=20source=20and=20 format=20them. Can=20somebody=20enlighten=20me,=20and=20shove=20me=20in=20the=20right=20d= irection? Ciao,=20J=FCrgen From smerten@oekonux.de Wed Apr 2 19:47:22 2003 From: smerten@oekonux.de (Stefan Merten) Date: Wed, 02 Apr 2003 21:47:22 +0200 Subject: rst-mode.el (was: [Doc-SIG] Re: rest-mode.el and more) In-Reply-To: Your message of "Thu, 27 Mar 2003 22:36:30 EST" <3E83C33E.2070801@python.org> Message-ID: <200304021947.h32JlMf18969@rosalu.merten-home.de> -----BEGIN PGP SIGNED MESSAGE----- Hi David and all! 5 days ago David Goodger wrote: > [Stefan Merten] >> I coded a font-lock mode which recognizes most reST constructs. >=20 > It looks quite good! :-) I'm glad it's helping people :-) . > I hope you continue to develop it. I already did. It now supports comments and literal blocks. However, this involves multi-line font-locking which is slightly beyond simple font-lock. Particularly typing gets **slooooow** when point is after such a block. Because of that the mode switches to `lazy-lock-mode' which one might configure independently. There is a customizable variable `rst-mode-lazy' which triggers this behavior so this can be switched off if it is more disturbing than useful. > Could it be made a derivative of indented-text-mode, so that it > inherits that mode's behavior? Or is it already, except for keymaps? > (How does one tell?) Or could this become a minor mode of > indented-text-mode? I'm actually nor an Emacs lisp hacker. I learned some Emacs lisp a long time ago and added to that over time but I did not follow the modern developments such as customization. In modern Emacsen I once saw a technique to derive a new mode from an old one. However, this seems not be supported everywhere. I'll check out how ``rst-mode`` can be integrated with ``indented-text-mode`` (which at least in 20.7 is just an alias for ``text-mode`` anyway). >> If you want to include it in an official CVS tree that's fine. >=20 > Thank you. I think I'll include it as tools/editors/emacs/rst-mode.el Meanwhile you added me to the developers. Thanks :-) . I just added:: docutils/tools/editors/emacs/rst-mode.el to the CVS repository. You may download it from:: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/docutils/docut= ils/tools/editors/emacs/rst-mode.el?rev=3DHEAD&content-type=3Dtext/plain > ("rst" not "rest", see below). I changed all the names to "rst" instead of "rest". I just needed a name to start with. Mit Freien Gr=FC=DFen Stefan -----BEGIN PGP SIGNATURE----- Version: 2.6.3in Charset: noconv Comment: Processed by Mailcrypt 3.5.7, an Emacs/PGP interface iQCVAwUBPos+SgnTZgC3zSk5AQHy3QQAqgyAcANHpAdpcAdegJC4wpKQbWf9N7+N HEHjuKPntw0trDv0PWx6sVrtxcEs/y8Kaf/+Z7/a2/AeSAp5bvk25hKxwcQI2jIM 2CQaPQqH19dkYwsVv59sldnBTMSmiDdpDnBEAsbSFqOwybHW9foAIUQckvJ97J1O 7npyJh7EoF8=3D =3DfH1D -----END PGP SIGNATURE----- From smerten@oekonux.de Wed Apr 2 19:53:59 2003 From: smerten@oekonux.de (Stefan Merten) Date: Wed, 02 Apr 2003 21:53:59 +0200 Subject: [Doc-SIG] Re: rst-mode.el In-Reply-To: Your message of "Wed, 02 Apr 2003 21:47:22 +0200" <200304021947.h32JlMf18969@rosalu.merten-home.de> Message-ID: <200304021953.h32Jrxf19089@rosalu.merten-home.de> -----BEGIN PGP SIGNED MESSAGE----- Hi all! I forgot this. 4 minutes ago Stefan Merten wrote: > I just added:: >=20 > docutils/tools/editors/emacs/rst-mode.el >=20 > to the CVS repository. You may download it from:: >=20 > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/docutils/doc= utils/tools/editors/emacs/rst-mode.el?rev=3DHEAD&content-type=3Dtext/plai= n I'm keen to know of any problems with that (besides the ones noted in the source already). Feel free to write me private mail. However, please don't expect to get a reply immediately. Mit Freien Gr=FC=DFen Stefan -----BEGIN PGP SIGNATURE----- Version: 2.6.3in Charset: noconv Comment: Processed by Mailcrypt 3.5.7, an Emacs/PGP interface iQCVAwUBPos/1wnTZgC3zSk5AQGB9gQAkPTnJG4aIerRwgsF5DVvBFggHJNz2NvV Lh26JSYUZdQ4QR6f+L5xYijMzp1And+f3KSDr0QTijWUuzBBxoX58JCqTjYjHxOy 144/HNIekHAzbF3CQVJLsgc0kHATPixhicEMqSOnBkbyeRUv2EsKc7OQANgUI7D+ fT3p1FsNrNA=3D =3DObKA -----END PGP SIGNATURE----- From goodger@python.org Fri Apr 4 23:51:18 2003 From: goodger@python.org (David Goodger) Date: Fri, 04 Apr 2003 18:51:18 -0500 Subject: [Doc-SIG] Using docutils on source code In-Reply-To: References: Message-ID: <3E8E1A76.1020106@python.org> Juergen Hermann wrote: > Maybe I'm thick here, but from a more than cursory look at the docs I > got the impression that docutils is still "just" a document processor, > and that there is no front-end to extract docstrings from source and > format them. > > Can somebody enlighten me, and shove me in the right direction? Docstring extraction is still under development (you're not thick, at least not in this instance ;-). I have most of a source code parsing module in docutils/readers/python/moduleparser.py. I haven't worked on it in a while, but I do plan to finish it eventually. Ian Bicking wrote an initial front end for my moduleparser module, in sandbox/ianb/extractor/extractor.py. -- David Goodger http://starship.python.net/~goodger Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv From ianb@colorstudy.com Sat Apr 5 00:44:18 2003 From: ianb@colorstudy.com (Ian Bicking) Date: 04 Apr 2003 18:44:18 -0600 Subject: [Doc-SIG] Re: Wikis using reST Message-ID: <1049503458.3784.43.camel@lothlorien> Someone pointed this thread out to me. I thought I'd note that the example application for the Web Framework Shootout is a Wiki using reST: http://colorstudy.com/docs/shootout.html It uses a generic Wiki module that is in the docutils sandbox CVS repository. It is certainly fairly primitive -- I wanted an example that could fit in a paper (actually fit in many times over) -- but the core Wiki concepts are delightfully simple, and it lives up to that at least. I'm interested in extending the module, as I like the basic architecture with a firm separation of content from interface. But there's lots of things I'm interested in extending... Ian From aahz@pythoncraft.com Tue Apr 15 02:14:50 2003 From: aahz@pythoncraft.com (Aahz) Date: Mon, 14 Apr 2003 21:14:50 -0400 Subject: [Doc-SIG] Python book ideas Message-ID: <20030415011450.GA25720@panix.com> [Cross-posted to both doc-sig and marketing-python] Last week I went to the Waterside Conference, which is a conference for writers and publishers put on by my agent's company. I picked up some good leads for book ideas, some of which I'm holding to myself for a bit while I talk with my agent, but I'd like to throw out one idea that's been mentioned before as a joke: _Python for VB6 Programmers_ According to a presentation I saw, one survey claims that more than 50% of VB6 programmers currently refuse to consider upgrading to VB.net. That's a huge market for us even if we only get a tiny slice of it. I'll be glad to assist someone else to find a publisher. Any takers? Another idea that I and others have been kicking around for a while is a data structures and algorithms book using Python. Based on what I saw at the conference, I think now would be a good time to start working on that, possibly beginning it as an Open Source project of some kind. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ This is Python. We don't care much about theory, except where it intersects with useful practice. --Aahz, c.l.py, 2/4/2002 From altis@semi-retired.com Tue Apr 15 03:04:46 2003 From: altis@semi-retired.com (Kevin Altis) Date: Mon, 14 Apr 2003 19:04:46 -0700 Subject: [Doc-SIG] RE: [marketing-python] Python book ideas In-Reply-To: <20030415011450.GA25720@panix.com> Message-ID: > From: Aahz > > [Cross-posted to both doc-sig and marketing-python] > > Last week I went to the Waterside Conference, which is a conference for > writers and publishers put on by my agent's company. I picked up some > good leads for book ideas, some of which I'm holding to myself for a bit > while I talk with my agent, but I'd like to throw out one idea that's > been mentioned before as a joke: _Python for VB6 Programmers_ Actually, I've mentioned it several times to some authors and O'Reilly and I definitely wasn't joking, though nobody has chosen to pursue the project as far as I know. The last person I brought this up with was Todd Mezzulo at O'Reilly. > According to a presentation I saw, one survey claims that more than 50% > of VB6 programmers currently refuse to consider upgrading to VB.net. > That's a huge market for us even if we only get a tiny slice of it. I'll > be glad to assist someone else to find a publisher. Any takers? Regardless of the exact number, there are definitely a lot of VB 6 folks that feel abandoned. MS has essentially told them to switch to .NET or die. It probably represents the single largest market segment that is ripe for a switch to Python, if the right environment is in place so that they can still leverage a simple to learn and use GUI IDE and that can leverage existing COM components and build standalones. The GUI IDE part is a bit rough, but win32all and py2exe take care of the latter. VBA and VBScript are other good "switch" opportunities. Unlike VB6, you can convert VBScript code to Python code without having to deal with the GUI issue. You can already use Python within Windows Script Host (WSH) but even better you can just avoid using WSH, Python does it better on its own. You can drive Outlook and write ASP code. Pretty much everything that is in the "VBScript in a Nutshell" book can be done better with Python. http://windows.oreilly.com/ As a bonus, many scripts can be written to work cross-platform which is something that Windows admins and web developers are starting to think about more and more. The first sections of diveintopython make some attempt at reaching the VB and VBScript user by mentioning the data structures and language elements they would be familiar with, but it is quite brief. http://diveintopython.org/ Some combination of "Python Programming on Win32" and "Learning Python" is probably the right answer for a "Python for VBA/VBScript Programmers" book. So, I guess I'm agreeing that there is at least a book or two here with a potentially huge audience; from hundreds of thousands to the low millions. ka > Another idea that I and others have been kicking around for a while is a > data structures and algorithms book using Python. Based on what I saw > at the conference, I think now would be a good time to start working on > that, possibly beginning it as an Open Source project of some kind. > -- > Aahz (aahz@pythoncraft.com) <*> > http://www.pythoncraft.com/ > > This is Python. We don't care much about theory, except where it > intersects > with useful practice. --Aahz, c.l.py, 2/4/2002 > _______________________________________________ > marketing-python mailing list > marketing-python@wingide.com > http://pythonology.org/mailman/listinfo/marketing-python > From magnus@thinkware.se Tue Apr 15 20:59:43 2003 From: magnus@thinkware.se (Magnus =?iso-8859-1?Q?Lyck=E5?=) Date: Tue, 15 Apr 2003 21:59:43 +0200 Subject: [Doc-SIG] Python book ideas In-Reply-To: <20030415011450.GA25720@panix.com> Message-ID: <5.2.1.1.0.20030415215112.00bd4d40@www.thinkware.se> At 21:14 2003-04-14 -0400, Aahz wrote: >[Cross-posted to both doc-sig and marketing-python] > >Last week I went to the Waterside Conference, which is a conference for >writers and publishers put on by my agent's company. I picked up some >good leads for book ideas, some of which I'm holding to myself for a bit >while I talk with my agent, but I'd like to throw out one idea that's >been mentioned before as a joke: _Python for VB6 Programmers_ I've recently done some VBA programming, and it struck me how many similarities there are between Python and VBA. I feel that Python syntax is VBA done right! When I thought about this I realized how rare it is that you see things like Python tutorials for VB programmers or comparisions between VB and Python sysntax etc. You can find side by side comparisions between Python and almost every programming language available as open source out there, but I've never seen any text (or Python book, and I have more than a dozen of them) explaining Python from a VB perspective. Not even Hammond & Robinson does this. Considering the amount of Visual Basic programmers out there, I think this is a great book idea. Probably one of the most needed Python books right now! -- Magnus Lycka, magnus@thinkware.se Thinkware AB, www.thinkware.se From guido@python.org Tue Apr 15 21:09:46 2003 From: guido@python.org (Guido van Rossum) Date: Tue, 15 Apr 2003 16:09:46 -0400 Subject: [Doc-SIG] Python book ideas In-Reply-To: Your message of "Tue, 15 Apr 2003 21:59:43 +0200." <5.2.1.1.0.20030415215112.00bd4d40@www.thinkware.se> References: <5.2.1.1.0.20030415215112.00bd4d40@www.thinkware.se> Message-ID: <200304152009.h3FK9ka29775@odiug.zope.com> > I've recently done some VBA programming, and it struck me > how many similarities there are between Python and VBA. I > feel that Python syntax is VBA done right! > > When I thought about this I realized how rare it is that you > see things like Python tutorials for VB programmers or > comparisions between VB and Python sysntax etc. You can find > side by side comparisions between Python and almost every > programming language available as open source out there, but > I've never seen any text (or Python book, and I have more > than a dozen of them) explaining Python from a VB perspective. > Not even Hammond & Robinson does this. > > Considering the amount of Visual Basic programmers out there, > I think this is a great book idea. Probably one of the most > needed Python books right now! I can get you in touch with a publisher if you need one. --Guido van Rossum (home page: http://www.python.org/~guido/) From aahz@pythoncraft.com Tue Apr 15 21:37:09 2003 From: aahz@pythoncraft.com (Aahz) Date: Tue, 15 Apr 2003 16:37:09 -0400 Subject: [Doc-SIG] Python book ideas In-Reply-To: <200304152009.h3FK9ka29775@odiug.zope.com> References: <5.2.1.1.0.20030415215112.00bd4d40@www.thinkware.se> <200304152009.h3FK9ka29775@odiug.zope.com> Message-ID: <20030415203707.GB8393@panix.com> On Tue, Apr 15, 2003, Guido van Rossum wrote: >Magnus: >> >> I've recently done some VBA programming, and it struck me >> how many similarities there are between Python and VBA. I >> feel that Python syntax is VBA done right! >> >> When I thought about this I realized how rare it is that you >> see things like Python tutorials for VB programmers or >> comparisions between VB and Python sysntax etc. You can find >> side by side comparisions between Python and almost every >> programming language available as open source out there, but >> I've never seen any text (or Python book, and I have more >> than a dozen of them) explaining Python from a VB perspective. >> Not even Hammond & Robinson does this. >> >> Considering the amount of Visual Basic programmers out there, >> I think this is a great book idea. Probably one of the most >> needed Python books right now! > > I can get you in touch with a publisher if you need one. Heh. That was my line, but you're obviously a better person if you've got the bandwidth. Magnus, if you want a co-author and nobody else responds to this thread here, I'd suggest posting to c.l.py and c.l.py.announce. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ This is Python. We don't care much about theory, except where it intersects with useful practice. --Aahz, c.l.py, 2/4/2002 From jordanm@uts.cc.utexas.edu Tue Apr 15 23:04:30 2003 From: jordanm@uts.cc.utexas.edu (Jordan McCoy) Date: Tue, 15 Apr 2003 17:04:30 -0500 Subject: [Doc-SIG] Greetings Message-ID: <000101c3039a$fd583850$2301a8c0@telos> Greetings and good day. Having just joined the DOC-sig, I wanted to introduce myself and determine the status of the work the SIG is doing, perhaps see what I could contribute. I've been working with Python (and programming in general) for quite a while, but only recently starting to involve myself with the community. I'm going to review the archives of the list, but would appreciate a quick summary of the current work of the SIG and what contributions the group is currently seeking. Thanks. Jordan McCoy jordanm@uts.cc.utexas.edu From goodger@python.org Sat Apr 19 04:23:11 2003 From: goodger@python.org (David Goodger) Date: Fri, 18 Apr 2003 23:23:11 -0400 Subject: [Doc-SIG] Greetings In-Reply-To: <000101c3039a$fd583850$2301a8c0@telos> References: <000101c3039a$fd583850$2301a8c0@telos> Message-ID: <3EA0C11F.4070001@python.org> Jordan McCoy wrote: > I'm going to review the archives of the list, but would appreciate a > quick summary of the current work of the SIG and what contributions the > group is currently seeking. Thanks. The SIG has two main focuses: documentation *of* Python, and documentation *with* Python. I'm sure Fred Drake, who's in charge of the documentation of Python, would welcome help on that front. There are several projects that use Python for documentation; Docutils (http://docutils.sf.net) is one of them, and has been monopolizing the Doc-SIG list for a while. We'd certainly welcome your help. What kind of contributions are you looking to make? -- David Goodger http://starship.python.net/~goodger Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv From aahz@pythoncraft.com Fri Apr 25 14:58:44 2003 From: aahz@pythoncraft.com (Aahz) Date: Fri, 25 Apr 2003 09:58:44 -0400 Subject: [Doc-SIG] Re: [marketing-python] 2.3 release - proposed plan In-Reply-To: References: <1050684637.12570.49.camel@ida.dylanreinhardt.com> <1051146156.22265.11.camel@ida.dylanreinhardt.com> <200304240048.h3O0mQR31446@pcp02138704pcs.reston01.va.comcast.net> <1051149264.22265.70.camel@ida.dylanreinhardt.com> <1051155688.22265.120.camel@ida.dylanreinhardt.com> <16039.64072.657758.943971@montanaro.dyndns.org> Message-ID: <20030425135844.GA11633@panix.com> [cc'ing doc-sig in case anyone is interested] On Fri, Apr 25, 2003, Patrick K. O'Brien wrote: > > When I gave my presentation to the ACM I just created an html page, > increased the font size in the browser, and scrolled through the > items. I've done my share of PowerPoint slides, but I'd rather have a > way to generate slides using reST. Kevin Altis said he's toying > around with something to do this. If you'd like, you can have my front-end to PythonPoint. (I created a dead-simple half-reSTed syntax to avoid the drudgery of writing XML.) Once Kevin does his work, it should be simple to modify my front-end to write out reST. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "In many ways, it's a dull language, borrowing solid old concepts from many other languages & styles: boring syntax, unsurprising semantics, few automatic coercions, etc etc. But that's one of the things I like about it." --Tim Peters on Python, 16 Sep 93 From pobrien@orbtech.com Fri Apr 25 15:15:21 2003 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: 25 Apr 2003 09:15:21 -0500 Subject: [Doc-SIG] Re: [marketing-python] 2.3 release - proposed plan In-Reply-To: <20030425135844.GA11633@panix.com> References: <1050684637.12570.49.camel@ida.dylanreinhardt.com> <1051146156.22265.11.camel@ida.dylanreinhardt.com> <200304240048.h3O0mQR31446@pcp02138704pcs.reston01.va.comcast.net> <1051149264.22265.70.camel@ida.dylanreinhardt.com> <1051155688.22265.120.camel@ida.dylanreinhardt.com> <16039.64072.657758.943971@montanaro.dyndns.org> <20030425135844.GA11633@panix.com> Message-ID: Aahz writes: > [cc'ing doc-sig in case anyone is interested] > > On Fri, Apr 25, 2003, Patrick K. O'Brien wrote: > > > > When I gave my presentation to the ACM I just created an html page, > > increased the font size in the browser, and scrolled through the > > items. I've done my share of PowerPoint slides, but I'd rather have a > > way to generate slides using reST. Kevin Altis said he's toying > > around with something to do this. > > If you'd like, you can have my front-end to PythonPoint. (I created a > dead-simple half-reSTed syntax to avoid the drudgery of writing XML.) > Once Kevin does his work, it should be simple to modify my front-end to > write out reST. Sure, I'd like to take a look at that. Thanks. I also see that Richard Jones has a pythonpoint writer in his docutils sandbox. Has anyone used it? -- Patrick K. O'Brien Orbtech http://www.orbtech.com/web/pobrien ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- From priest@sfu.ca Fri Apr 25 15:38:48 2003 From: priest@sfu.ca (David Priest) Date: Fri, 25 Apr 2003 07:38:48 -0700 Subject: [Doc-SIG] Re: [marketing-python] 2.3 release - proposed plan In-Reply-To: <20030425135844.GA11633@panix.com> References: <1050684637.12570.49.camel@ida.dylanreinhardt.com> <1051146156.22265.11.camel@ida.dylanreinhardt.com> <200304240048.h3O0mQR31446@pcp02138704pcs.reston01.va.comcast.net> <1051149264.22265.70.camel@ida.dylanreinhardt.com> <1051155688.22265.120.camel@ida.dylanreinhardt.com> <16039.64072.657758.943971@montanaro.dyndns.org> <20030425135844.GA11633@panix.com> Message-ID: On Fri, 25 Apr 2003 09:58:44 -0400, Aahz wrote: > "In many ways, it's a dull language, borrowing solid old concepts > from many other languages & styles: boring syntax, unsurprising > semantics, few automatic coercions, etc etc. But that's one of > the things I like about it." --Tim Peters on Python, 16 Sep 93 This is, I think, a quote that should be used in marketing Python. It's a familiar, powerful, *comfortable* language, with all the power required to create full, powerful applications quickly and easily. Take away the fear ("it's a dull language") and promote its power. From aahz@pythoncraft.com Fri Apr 25 16:24:16 2003 From: aahz@pythoncraft.com (Aahz) Date: Fri, 25 Apr 2003 11:24:16 -0400 Subject: [Doc-SIG] PythonPoint front-end In-Reply-To: References: <1051146156.22265.11.camel@ida.dylanreinhardt.com> <200304240048.h3O0mQR31446@pcp02138704pcs.reston01.va.comcast.net> <1051149264.22265.70.camel@ida.dylanreinhardt.com> <1051155688.22265.120.camel@ida.dylanreinhardt.com> <16039.64072.657758.943971@montanaro.dyndns.org> <20030425135844.GA11633@panix.com> Message-ID: <20030425152415.GC13187@panix.com> --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 25, 2003, Patrick K. O'Brien wrote: > Aahz writes: >> >> If you'd like, you can have my front-end to PythonPoint. (I created a >> dead-simple half-reSTed syntax to avoid the drudgery of writing XML.) >> Once Kevin does his work, it should be simple to modify my front-end to >> write out reST. > > Sure, I'd like to take a look at that. Thanks. I also see that > Richard Jones has a pythonpoint writer in his docutils sandbox. Has > anyone used it? Here you go. I'm including my PyCon objects presentation so you can see how it works. (Haven't tried using Richard's bit; I wrote mine a year ago when reST was really in the Dark Ages. ;-) (It'll be available on my web site Real Soon Now....) -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "In many ways, it's a dull language, borrowing solid old concepts from many other languages & styles: boring syntax, unsurprising semantics, few automatic coercions, etc etc. But that's one of the things I like about it." --Tim Peters on Python, 16 Sep 93 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="stx2xml.py" import sys import os import re import imp import cgi #cfg = imp.new_module('cfg') class cfg: pass tagDict = {} class Tag: closes = [] def __init__(self): self._attr = {} self.elements = [] def default(self, value): pass def end(self): raise NotImplementedError def output(self): raise NotImplementedError def get_attrs(self): tmp = [] for key,value in self._attr.iteritems(): tmp.append('%s="%s"' % (key,value)) return ' '.join(tmp) class Presentation(Tag): def __init__(self): Tag.__init__(self) tagStack = [] def pragma_outputFile(self, value): self.outputFile = value def pragma_style(self, value): mod, func = value.split(',') self.styleMod, self.styleFunc = mod, func f, p, d = imp.find_module(mod) mod = imp.load_module(mod, f, p, d) func = getattr(mod, func) cfg.styles = func() def pragma_frame(self, value): cfg.pageFrame = tuple(value.split(',')) def pragma_footer(self, value): cfg.footerFrame = tuple(value.split(',')) def pragma_codeRatio(self, value): cfg.codeRatio = float(value) def output(self): self.setFooters() tmp = [] tmp.append('' % self.get_attrs()) mod, func = self.styleMod, self.styleFunc tmp.append('' % (mod, func)) tmp.append('
') for slide in self.elements: tmp.append(slide.output()) tmp.append('
\n
') return '\n\n'.join(tmp) def setFooters(self): numPages = len(self.elements) pageNo = 0 for slide in self.elements: pageNo += 1 slide.pageNo = pageNo slide.numPages = numPages tagDict['presentation'] = Presentation class Para(Tag): tagName = 'para' styleName = None reCode = re.compile("``([^`]+)``") def __init__(self): Tag.__init__(self) self.codeSize = None def getCodeSize(self): fontSize = cfg.styles[self.styleName].fontSize self.codeSize = round(fontSize * cfg.codeRatio, 1) def parse(self, line): if self.codeSize is None: self.getCodeSize() repl = r'\1' % self.codeSize return self.reCode.sub(repl, line) def default(self, value): value = self.parse(value) self.elements.append(value) def end(self): pass def output(self): outdict = { 'tagName': self.tagName, 'style': 'style="%s"' % self.styleName, 'data': '\n'.join(self.elements) } tmp = '<%(tagName)s %(style)s>%(data)s' % outdict return tmp Para.closes = [Para] class PreFmt(Para): tagName = 'prefmt' styleName = 'Normal' tagDict['prefmt'] = PreFmt class Slide(Tag): def __init__(self): Tag.__init__(self) def pragma_title(self, value): self._attr['title'] = value tmp = Title() tmp.default(value) self.elements.append(tmp) def pragma_head(self, value): self._attr['title'] = value.replace("``", "") tmp = Head() tmp.default(value) self.elements.append(tmp) def end(self): pass def output(self): tmp = [] tmp.append('' % self.get_attrs()) tmp.append(make_frame(cfg.pageFrame)) for tag in self.elements: tmp.append(tag.output()) tmp.append('') tmp.append(make_frame(cfg.footerFrame)) pageNo, numPages = self.pageNo, self.numPages f = '%s' % pageNo tmp.append(f) tmp.append('') tmp.append('') return '\n'.join(tmp) Slide.closes = [Para, Slide] tagDict['slide'] = Slide class Title(Para): styleName = 'title' tmp = Title tagDict[tmp.styleName] = tmp class Head(Para): styleName = 'head' tmp = Head tagDict[tmp.styleName] = tmp class SmallTitle(Para): styleName = 'smalltitle' tmp = SmallTitle tagDict[tmp.styleName] = tmp class Normal(Para): styleName = 'normal' tmp = Normal tagDict[tmp.styleName] = tmp class Bullet(Para): styleName = 'Bullet' # PythonPoint needs cap :-( tagDict['bullet'] = Bullet class Indent(Para): styleName = 'indent' tmp = Indent tagDict[tmp.styleName] = tmp class URL(Para): styleName = 'url' tmp = URL tagDict[tmp.styleName] = tmp class Code(PreFmt): styleName = 'code' def default(self, value): value = cgi.escape(value) PreFmt.default(self, value) def pragma_include(self, value): data = open(value).read() data = cgi.escape(data) self.elements.append(data) tmp = Code tagDict[tmp.styleName] = tmp class Spacer(Para): def output(self): return '' % self.get_attrs() tagDict['spacer'] = Spacer class NumberedList(Para): def default(self, value): self.elements.append(value) def output(self): i = 1 tmp = [] for item in self.elements: s = '%s. %s' % (i, item) tmp.append(s) i += 1 return '\n'.join(tmp) tagDict['numlist'] = NumberedList def make_frame(frame): return '' % frame def dispatch_tag(tag, root): newTag = tagDict[tag]() tagStack = root.tagStack #print tag, newTag.closes for tagType in newTag.closes: currTag = tagStack[-1] #print isinstance(currTag, tagType) if isinstance(currTag, tagType): currTag.end() tagStack.pop() tagStack[-1].elements.append(newTag) tagStack.append(newTag) #print tagStack def dispatch_attrib(line, root): currTag = root.tagStack[-1] key, value = line.split(' ', 1) currTag._attr[key] = value def dispatch_pragma(line, root): currTag = root.tagStack[-1] pragma, value = line.split(' ', 1) meth = getattr(currTag, 'pragma_' + pragma) meth(value) def dispatch_comment(line, root): pass dispatch = { '.': dispatch_tag, '=': dispatch_attrib, '@': dispatch_pragma, '#': dispatch_comment, } def parse(input): root = Presentation() root.tagStack = [root] try: for line in input: line = line.rstrip() if not line: root.tagStack[-1].default(line) continue ch = line[0] if ch in dispatch: # handle continuation lines in interactive mode if line[1] == '.': root.tagStack[-1].default(line) else: dispatch[ch](line[1:], root) else: root.tagStack[-1].default(line) except KeyError: print line raise return root def write(root): f = open(root.outputFile, 'w') f.write(root.output()) # print root.output() def process(input): input = open(input) root = parse(input) write(root) if __name__ == '__main__': input = sys.argv[1] process(input) --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pyobj.stx" =filename pyobj.pdf @outputFile pyobj.xml @style style,Styles @frame 0,0,782,612 @footer 0,5,787,25 @codeRatio 0.85 .slide @title Python Objects and New-style Classes .spacer =height 40 .smalltitle Aahz .spacer =height 20 .smalltitle ``aahz@pythoncraft.com`` .smalltitle ``http://pythoncraft.com/`` .spacer =height 60 .smalltitle Powered by PythonPoint .spacer =height 10 .smalltitle ``http://www.reportlab.com/`` .slide =outlinelevel 1 @head Before we begin... .bullet I'm hearing-impaired .indent Please speak slowly and clearly .slide @head Overall .bullet Goal: understand objects .indent Use new-style classes to illuminate .url http://www.python.org/2.2.2/descrintro.html .indent No classic classes .bullet Timing .indent 30 minutes core material .indent 15 minutes optional material .indent # Deal with stupid ReportLab entity bug 15-30 minutes Q&amp;A .slide @head Contents .bullet Object Basics .bullet Type/class tangle .bullet Memory management .bullet Optional Material .indent Mutable/immutable .slide @head Object Basics .bullet Objects .bullet Targets .bullet Namespace/Scope .slide =outlinelevel 1 @head Objects Defined .bullet Object is structured memory .bullet Object has: .indent Type .indent Namespace (attributes) .indent Value (optional: int/string objects have value, files don't) .slide =outlinelevel 1 @head Everything an Object .bullet All data is object .indent Functions, types, classes, class instances, iterators, generators, modules, and files all first-class objects .bullet Capabilities .indent Objects all have same potential capabilities, but objects choose which capabilities to expose. .indent The type determines the capabilities. .indent ("Capability" in its generic sense, essentially "set of data/methods" -- not the python-dev thread. ;-) .slide =outlinelevel 1 @head Accessing objects .bullet Targets contain bindings to objects .indent "Binding" used instead of "reference" because you can only deal with objects directly, never the references themselves (except in C API). .slide =outlinelevel 1 @head Kinds of Targets .bullet Names .bullet Attributes .indent Names in object space, accessed with dot notation .bullet Computed .indent Indexes / Keys .bullet Anonymous .indent E.g. ``return`` or function defaults .indent Important for understanding refcounts .slide =outlinelevel 1 @head Names .bullet What's a name? .indent Bare word at builtin, module global, or function scope (more on scope shortly) .bullet "Name" instead of "variable" .indent Names in Python don't contain data, only bindings; they're used like variables, mostly, but use "names" instead to remember the semantics .slide =outlinelevel 1 @head Each Object a Namespace .bullet Attributes .indent Objects contain dict that maps key/value pairs to names and objects. For some objects (primarily built-in types, function locals, and some new-style classes), dict gets mapped to vector for reduced memory consumption and speed. .slide =outlinelevel 1 @head Binding Operations .bullet Creating names .indent ``=``, ``for`` (and list comprehensions), ``def``, ``import`` (all forms), ``class``, function/method parameters, ``except`` block (second parameter) .bullet Other targets .indent ``=`` (sequences/maps), ``return``, ``yield``, ``print``, function/method default parameters .slide =outlinelevel 1 @head Namespace Demo .bullet ``namespace.py`` .slide =outlinelevel 1 @head Scope .bullet Two scope hierarchies: .indent Execution scope .indent Class inheritance scope .bullet Read-only .indent Non-local scopes are read-only unless made explicit .slide =outlinelevel 1 @head Execution Scope .bullet Searches three namespaces in order: .indent Function local .indent Module global .indent Builtins .bullet Shadowing .indent Locals shadow globals shadow builtins .slide =outlinelevel 1 @head Nested Scopes .bullet Functions inside functions .bullet Lexical scope .indent Not dynamic scope .indent Allows static analysis of source code .bullet Python 2.1 .indent ``from __future__ import nested_scopes`` .slide =outlinelevel 1 @head Class Inheritance Scope .bullet Non-standard "scope" usage .indent Some people disagree with me that class attribute/method inheritance should be discussed as a "scope", but it's a convenient way to explain the similarities with execution scope .bullet ``self`` .indent Used in methods to distinguish between execution scope (implicit as in other functions) and the class inheritance scope (which is made explicit through ``self``) .slide =outlinelevel 1 @head Scope Demo .bullet ``scope.py`` .slide @head Type/Class Tangle .bullet Inheritance vs. creation .bullet Class vs. instance .slide =outlinelevel 1 @head Inheritance vs. creation .bullet Inheritance .indent Attribute search path .bullet Type .indent Types are objects that create other objects .indent Metaclass is type that generates classes; class is type that generates class instances .indent ``type(Foo) == Foo.__class__`` .bullet Instance .indent Instance is an object created by a type .slide =outlinelevel 1 @head Class vs. Instance .bullet Instance attribute .indent Access with ``self`` .bullet Class attribute .indent Access with class name .indent But remember that a class is also an instance... .slide =outlinelevel 1 @head More Inheritance .bullet Bases vs. Types .indent An instance's inheritance searches its type, then its type's base classes. Inheritance does NOT search the type's type. .slide =outlinelevel 1 @head Type/Class Demo .bullet ``typeclass.py`` .slide @head Memory Management .bullet Reference counts .bullet Garbage collection .bullet ``__slots__`` .slide =outlinelevel 1 @head Reference Counts .bullet Object deletion .indent Objects are deleted when no bindings reference object .bullet Binding .indent Each binding increases refcount .bullet Decrease refcount .indent Rebinding .indent Name going out of scope .indent ``del`` .slide =outlinelevel 1 @head ``del`` .bullet Deletes bindings, not objects .bullet Can ``del`` parts of objects: .spacer =height 10 .code >>> L = [1,2,3,4,5] >>> del L[1:3] >>> L [1, 4, 5] >>> d = {'a': 1, 'b': 2, 'c': 5} >>> del d['b'] >>> d {'a': 1, 'c': 5} .slide =outlinelevel 1 @head Refcount Cascades .bullet Objects refer to other objects .indent When an object gets deleted, all objects it refers to get decremented and may be deleted -- leading to a cascade of object deletions .bullet Large lists/dicts .indent Deleting a large list or dict can take a long time as each object in the list/dict needs to be walked .slide =outlinelevel 1 @head GC .bullet Garbage collection .indent In addition to refcount, not instead of .bullet Cycles .indent Occur when two or more objects refer to each other; refcount can't go to zero. If no external targets refer to cycle, cycle is "garbage" and GC deletes it. .bullet ``__del__()`` .indent Objects with ``__del__()`` can't be GC'd because of ordering problem .slide =outlinelevel 1 @head Refcount/GC Demo .bullet ``refcount_gc.py`` .slide =outlinelevel 1 @head ``__slots__`` .bullet Attributes .indent Normally stored in dict .indent ``__slots__`` creates indexed vector .indent Attribute names stored with class, not instance .slide @head Mutable vs. Immutable .bullet Immutable objects .indent Strings, numbers, tuples, some class instances, and combinations .bullet Mutable objects .indent Lists, dicts, most classes and class instances .bullet Why immutable? .indent Dict keys, space efficiency .slide =outlinelevel 1 @head Mutable Subtleties .bullet Lists embedded in tuples .spacer =height 10 .code >>> a = (1, ['foo'], 's') >>> a[1] = {'foo': 'bar'} Traceback (most recent call last): File "", line 1, in ? TypeError: object doesn't support item assignment >>> a[1].append('bar') >>> a (1, ['foo', 'bar'], 's') .spacer =height 5 .bullet Classes .indent Cannot force class immutable; it's an implied contract in code and documentation (must use C API to force immutable) .slide =outlinelevel 1 @head Copy Semantics (for function calls) .bullet Immutables don't need copy .bullet Mutables must be copied .indent If you don't want them modified, that is .slide =outlinelevel 1 @head Copy Example .spacer =height 15 .normal ``list.sort()`` is an in-place operation; here we create a function that returns the list .spacer =height 10 .code >>> def sort(L): ... L.sort() ... return L ... >>> L = [11, 7, 12, 5] >>> sort(L[:]) [5, 7, 11, 12] >>> L [11, 7, 12, 5] >>> sort(L) [5, 7, 11, 12] >>> L [5, 7, 11, 12] .spacer =height 15 .normal Notice how failing to make copy modifies original list .slide =outlinelevel 1 @head Mutability Again .bullet ``=`` vs. ``+=`` (and family) .indent ``=`` always [re]binds .indent mutable vs. immutable .indent ``+=`` may rebind ``self`` to original object if mutable (but not required) .slide =outlinelevel 1 @head Tuples and ``+=`` .spacer =height 10 .code >>> a = (1, ['foo'], 'xyzzy') >>> a[1].append('bar') >>> a (1, ['foo', 'bar'], 'xyzzy') >>> a[1] = 9 Traceback (most recent call last): File "", line 1, in ? TypeError: object doesn't support item assignment >>> a (1, ['foo', 'bar'], 'xyzzy') >>> a[1] += ['spam'] Traceback (most recent call last): File "", line 1, in ? TypeError: object doesn't support item assignment >>> a (1, ['foo', 'bar', 'spam'], 'xyzzy') .slide =outlinelevel 1 @head ``+=`` expansion .spacer =height 10 .code a.__setitem__(1, a.__getitem__(1).__iadd__(['spam'])) .spacer =height 15 .normal Rewrite with temp vars: .spacer =height 10 .code >>> a = (1, ['foo', 'bar'], 'xyzzy') >>> x = a.__getitem__(1) >>> x ['foo', 'bar'] >>> x.__iadd__(['spam']) ['foo', 'bar', 'spam'] >>> a.__setitem__(1, x) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'tuple' object has no attribute '__setitem__' >>> a (1, ['foo', 'bar', 'spam'], 'xyzzy') --0OAP2g/MAC+5xKAE-- From Nicolas.Chauvat@logilab.fr Fri Apr 25 20:20:29 2003 From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat) Date: Fri, 25 Apr 2003 21:20:29 +0200 Subject: [Doc-SIG] Re: [marketing-python] 2.3 release - proposed plan In-Reply-To: <20030425135844.GA11633@panix.com> References: <1050684637.12570.49.camel@ida.dylanreinhardt.com> <1051146156.22265.11.camel@ida.dylanreinhardt.com> <200304240048.h3O0mQR31446@pcp02138704pcs.reston01.va.comcast.net> <1051149264.22265.70.camel@ida.dylanreinhardt.com> <1051155688.22265.120.camel@ida.dylanreinhardt.com> <16039.64072.657758.943971@montanaro.dyndns.org> <20030425135844.GA11633@panix.com> Message-ID: <20030425192029.GH21581@logilab.fr> On Fri, Apr 25, 2003 at 09:58:44AM -0400, Aahz wrote: > [cc'ing doc-sig in case anyone is interested] > > On Fri, Apr 25, 2003, Patrick K. O'Brien wrote: > > > > When I gave my presentation to the ACM I just created an html page, > > increased the font size in the browser, and scrolled through the > > items. I've done my share of PowerPoint slides, but I'd rather have a > > way to generate slides using reST. Kevin Altis said he's toying > > around with something to do this. > > If you'd like, you can have my front-end to PythonPoint. (I created a > dead-simple half-reSTed syntax to avoid the drudgery of writing XML.) > Once Kevin does his work, it should be simple to modify my front-end to > write out reST. I want it! I almost wrote one six month ago and stopped halfway due to lack of time. -- Nicolas Chauvat http://www.logilab.com - "Mais oł est donc Ornicar ?" - LOGILAB, Paris (France) From aahz@pythoncraft.com Sat Apr 26 15:05:55 2003 From: aahz@pythoncraft.com (Aahz) Date: Sat, 26 Apr 2003 10:05:55 -0400 Subject: [Doc-SIG] Re: PythonPoint front-end In-Reply-To: References: <20030425152415.GC13187@panix.com> Message-ID: <20030426140554.GA21156@panix.com> --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 25, 2003, Kevin Altis wrote: > > Hey Aahz, > I couldn't get the script to run. > > ImportError: No module named style Oops. I've only run this as part of the PythonPoint toolchain, so I forgot about that. I've long since had to run PythonPoint only with a style file, so my stx2xml partly relies on that. I'm attaching the style.py that I used. > What are the module/package requirements? Do you have a URL to the PDF > output so I can just look at that? Real Soon Now. ;-) (It's part of my full PyCon package.) > The thing I was thinking of doing would be pretty darn simple, so it would > be interesting to get your requirements for the presentation tool/output > since I haven't done many presentations. I'm sort of leaning towards wiki > pages with some special CSS style sheets. Well, I don't like web pages much, so that doesn't work for me. I chose this route because I needed the fine-grained control. (Just like PowerPoint.) -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "In many ways, it's a dull language, borrowing solid old concepts from many other languages & styles: boring syntax, unsurprising semantics, few automatic coercions, etc etc. But that's one of the things I like about it." --Tim Peters on Python, 16 Sep 93 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="style.py" #from reportlab.platypus import TableStyle from reportlab.platypus.tables import TableStyle from reportlab.lib import styles from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY from reportlab.lib import colors def Styles(): stylesheet = {} ParagraphStyle = styles.ParagraphStyle para = ParagraphStyle('Normal', None) #the ancestor of all para.fontName = 'Times-Roman' para.fontSize = 30 para.leading = para.fontSize * 1.2 stylesheet['Normal'] = para stylesheet['normal'] = para #This one is spaced out a bit... para = ParagraphStyle('BodyText', stylesheet['Normal']) para.spaceBefore = 12 stylesheet['BodyText'] = para para = ParagraphStyle('Centered', stylesheet['Normal']) para.alignment = TA_CENTER stylesheet['Centered'] = para para = ParagraphStyle('BigCentered', stylesheet['Normal']) para.spaceBefore = 12 para.alignment = TA_CENTER stylesheet['BigCentered'] = para para = ParagraphStyle('Italic', stylesheet['BodyText']) para.fontName = 'Times-Italic' stylesheet['Italic'] = para para = ParagraphStyle('Footer', stylesheet['Normal']) para.fontSize = 18 para.leading = 0 para.alignment = TA_RIGHT stylesheet['Footer'] = para para = ParagraphStyle('Title', stylesheet['Normal']) para.fontName = 'Times-Roman' para.fontSize = para.fontSize * 3.0 para.leading = para.fontSize * 1.0 para.spaceAfter = para.fontSize * 0.2 para.alignment = TA_CENTER stylesheet['Title'] = para stylesheet['title'] = para para = ParagraphStyle('SmallTitle', stylesheet['Normal']) para.fontName = 'Times-Roman' para.fontSize = stylesheet['Title'].fontSize * 0.5 para.leading = para.fontSize * 1.0 para.alignment = TA_CENTER stylesheet['SmallTitle'] = para stylesheet['smalltitle'] = para para = ParagraphStyle('Heading1', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = para.fontSize * 2.25 para.leading = para.fontSize * 1.1 para.spaceAfter = para.fontSize * 0.15 para.alignment = TA_CENTER stylesheet['Heading1'] = para stylesheet['head'] = para para = ParagraphStyle('Heading2', stylesheet['Normal']) para.fontName = 'Times-Bold' para.fontSize = para.fontSize * 1.6 para.leading = para.fontSize * 1.2 para.spaceBefore = para.fontSize * 0.8 stylesheet['Heading2'] = para para = ParagraphStyle('Heading3', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.spaceBefore = 24 stylesheet['Heading3'] = para para = ParagraphStyle('Heading4', stylesheet['Normal']) para.fontName = 'Times-BoldItalic' para.spaceBefore = 6 stylesheet['Heading4'] = para para = ParagraphStyle('Bullet', stylesheet['Normal']) para.firstLineIndent = 10 para.leftIndent = 16 para.fontSize = para.fontSize * 1.5 para.leading = para.fontSize * 1.1 para.spaceBefore = para.fontSize * 0.4 para.bulletFontName = 'Symbol' para.bulletFontSize = para.fontSize * 0.7 para.bulletIndent = 20 stylesheet['Bullet'] = para stylesheet['bullet'] = para # doesn't work #Indented, for lists para = ParagraphStyle('Indent', stylesheet['Normal']) para.fontSize = stylesheet['Bullet'].fontSize * 0.75 para.leftIndent = para.fontSize * 2.5 para.leading = para.fontSize * 1.1 para.spaceBefore = para.fontSize * 0.2 stylesheet['Indent'] = para stylesheet['indent'] = para para = ParagraphStyle('Definition', stylesheet['Normal']) #use this for definition lists para.firstLineIndent = 72 para.leftIndent = 72 para.bulletIndent = 0 para.spaceBefore = 12 para.bulletFontName = 'Helvetica-BoldOblique' para.bulletFontSize = 24 stylesheet['Definition'] = para para = ParagraphStyle('Code', stylesheet['Normal']) para.fontName = 'Courier' #para.fontSize = para.fontSize * 0.75 para.fontSize = para.fontSize * 0.8 para.leading = para.fontSize + 1 para.leftIndent = 36 stylesheet['Code'] = para stylesheet['code'] = para para = ParagraphStyle('CodeHeader', stylesheet['Normal']) para.fontSize = stylesheet['Code'].fontSize * 1.5 para.spaceAfter = para.fontSize * 0.2 para.leftIndent = 36 para.firstLineIndent = para.leftIndent stylesheet['CodeHeader'] = para para = ParagraphStyle('NumList', stylesheet['Normal']) para.fontSize = 24 para.leading = para.fontSize * 1.1 stylesheet['NumList'] = para para = ParagraphStyle('URL', stylesheet['Normal']) para.fontName = 'Courier' para.fontSize = 24 para.leading = para.fontSize + 2 para.leftIndent = 10 stylesheet['url'] = para para = ParagraphStyle('Small', stylesheet['Normal']) para.fontSize = 12 para.leading = 14 stylesheet['Small'] = para #now for a table ts = TableStyle([ ('FONT', (0,0), (-1,-1), 'Times-Roman', 24), ('LINEABOVE', (0,0), (-1,0), 2, colors.green), ('LINEABOVE', (0,1), (-1,-1), 0.25, colors.black), ('LINEBELOW', (0,-1), (-1,-1), 2, colors.green), ('LINEBEFORE', (-1,0), (-1,-1), 2, colors.black), ('ALIGN', (1,1), (-1,-1), 'RIGHT'), #all numeric cells right aligned ('TEXTCOLOR', (0,1), (0,-1), colors.red), ('BACKGROUND', (0,0), (-1,0), colors.Color(0,0.7,0.7)) ]) stylesheet['table1'] = ts para = stylesheet['Code'] ts = TableStyle([ ('FONT', (0,0), (-1,0), 'Times-Roman', para.fontSize*1.5 ), ('FONT', (0,1), (-1,-1), 'Courier', para.fontSize), ]) stylesheet['2code'] = ts return stylesheet --AhhlLboLdkugWU4S--