[Zope-Checkins] CVS: Zope/lib/python/StructuredText/regressions - create_referencesfiles.py:1.1 Acquisition.ref:1.6 ExtensionClass.ref:1.6 Links.ref:1.4 Links.stx:1.4 MultiMapping.ref:1.6 examples.ref:1.5 examples1.ref:1.2 index.ref:1.5 table.ref:1.3
Andreas Jung
andreas@zope.com
Fri, 19 Oct 2001 09:21:10 -0400
Update of /cvs-repository/Zope/lib/python/StructuredText/regressions
In directory cvs.zope.org:/tmp/cvs-serv32122/regressions
Modified Files:
Acquisition.ref ExtensionClass.ref Links.ref Links.stx
MultiMapping.ref examples.ref examples1.ref index.ref
table.ref
Added Files:
create_referencesfiles.py
Log Message:
- _..._ was still broken. Even more __....__ was broken. Underlines are evil.
- added script to recreate regression reference files
- added another test
=== Added File Zope/lib/python/StructuredText/regressions/create_referencesfiles.py ===
##############################################################################
#
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# This license has been certified as Open Source(tm).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions in source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions, and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. Digital Creations requests that attribution be given to Zope
# in any manner possible. Zope includes a "Powered by Zope"
# button that is installed by default. While it is not a license
# violation to remove this button, it is requested that the
# attribution remain. A significant investment has been put
# into Zope, and this effort will continue if the Zope community
# continues to grow. This is one way to assure that growth.
#
# 4. All advertising materials and documentation mentioning
# features derived from or use of this software must display
# the following acknowledgement:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# In the event that the product being advertised includes an
# intact Zope distribution (with copyright and license included)
# then this clause is waived.
#
# 5. Names associated with Zope or Digital Creations must not be used to
# endorse or promote products derived from this software without
# prior written permission from Digital Creations.
#
# 6. Modified redistributions of any form whatsoever must retain
# the following acknowledgment:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# Intact (re-)distributions of any official Zope release do not
# require an external acknowledgement.
#
# 7. Modifications are encouraged but must be packaged separately as
# patches to official Zope releases. Distributions that do not
# clearly separate the patches from the original work must be clearly
# labeled as unofficial distributions. Modifications which do not
# carry the name Zope may be packaged in any form, as long as they
# conform to all of the clauses above.
#
#
# Disclaimer
#
# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations. Specific
# attributions are listed in the accompanying credits file.
#
##############################################################################
import os
from StructuredText.StructuredText import HTML
files = os.listdir('.')
files = filter(lambda x: x.endswith('.stx'), files)
for f in files:
data = open(f,'r').read()
html = HTML(data)
outfile = f.replace('.stx','.ref')
open(outfile,'w').write(html)
=== Zope/lib/python/StructuredText/regressions/Acquisition.ref 1.5 => 1.6 ===
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/ExtensionClass.ref 1.5 => 1.6 ===
it's <code>__of__</code> method is called:<p> import ExtensionClass</p>
<h5> class ComputedAttribute(ExtensionClass.Base):</h5>
-<p> def _<u>init</u>_(self, func): self.func=func</p>
-<p> def _<u>of</u>_(self, parent): return self.func(parent)</p>
+<p> def __init__(self, func): self.func=func</p>
+<p> def __of__(self, parent): return self.func(parent)</p>
</p>
<p> Then we can use this class to create computed attributes. In the
example below, we create a computed attribute, 'radius':<p> from math import sqrt</p>
<h5> class Point(ExtensionClass.Base):</h5>
-<p> def _<u>init</u>_(self, x, y): self.x, self.y = x, y</p>
+<p> def __init__(self, x, y): self.x, self.y = x, y</p>
<p> radius=ComputedAttribute(lambda self: sqrt(self.x<strong>2+self.y</strong>2))</p>
</p>
<h5> which we can use just like an ordinary attribute:</h5>
@@ -612,4 +612,3 @@
<p>.. <a href="#6">[6]</a> Beaudry, D., and Ascher, D., <a href="http://starship.skyport.net/~da/mess/">The Meta-Extension Set</a>.</p>
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/Links.ref 1.3 => 1.4 ===
<li><p>please click <a href="/Members/Zope">here</a></p></li>
<li><p>please click <a href="/Members/Zope?a=b&c=d%20blabla">here</a></p></li>
-<li><p>please click <a href="http://www.zope.org">here</a>" </p></li>
-<li><p>please click <a href="http://www.zope.org/members/">here</a>" </p></li>
-<li><p>please click <a href="http://www.zope.org:2001">here</a>" </p></li>
-<li><p>please click <a href="http://www.zope.org:2001/members/">here</a>" </p></li>
+<li><p>please click <a href="http://www.zope.org">here</a></p></li>
+<li><p>please click <a href="http://www.zope.org/members/">here</a></p></li>
+<li><p>please click <a href="http://www.zope.org:2001">here</a> </p></li>
+<li><p>please click <a href="http://www.zope.org:2001/members/">here</a></p></li>
<li><p>please click <a href="http://www.zope.org:2001/%20/Members/zope?a=222&b=213&_xc=just%20a%20test">here</a> </p></li>
<li><p>please click <a href="http://www.zope.org:2001/%20/Members/zope?a=222&b=213&_xc=just%20a%20test">here</a> </p></li>
<li><p>please click <a href="http://www.zope.org:2001/%20/Members/zope?a=222&b=213&_xc=just%20a%20test">here</a> </p></li>
@@ -21,4 +21,3 @@
<a href="http://www.zope-is-kewl.com">Link 2</a> and <a href="http://www.freshmeat.net">one more link - yeah.</a></p>
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/Links.stx 1.3 => 1.4 ===
- please click "here":/Members/Zope?a=b&c=d%20blabla
- - please click "here":http://www.zope.org"
+ - please click "here":http://www.zope.org
- - please click "here":http://www.zope.org/members/"
+ - please click "here":http://www.zope.org/members/
- - please click "here":http://www.zope.org:2001"
+ - please click "here":http://www.zope.org:2001
- - please click "here":http://www.zope.org:2001/members/"
+ - please click "here":http://www.zope.org:2001/members/
- please click "here":http://www.zope.org:2001/%20/Members/zope?a=222&b=213&_xc=just%20a%20test
=== Zope/lib/python/StructuredText/regressions/MultiMapping.ref 1.5 => 1.6 ===
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/examples.ref 1.4 => 1.5 ===
should contain a reference to this footnote, footnote "<a href="#1">[1]</a>".)<p> Some hrefs, in a definition list:</p>
<dl>
-<dt> <u>Regular</u></dt>
+<dt> _Regular_</dt>
<dd><a href="http://www.zope.org">http://www.zope.org/</a></dd>
-<dt> <u>W/trailing punctuation</u></dt>
+<dt> _W/trailing punctuation_</dt>
<dd><a href="http://www.zope.org">http://www.zope.org/</a>.</dd>
-<dt> <u>W protocol implicit</u></dt>
+<dt> _W protocol implicit_</dt>
<dd><a href=":locallink">locallink</a></dd>
<dt> <u>W protocol implicit</u>, alternate</dt>
<dd>"locallink", :locallink</dd>
@@ -46,4 +46,3 @@
</p>
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/examples1.ref 1.1 => 1.2 ===
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/index.ref 1.4 => 1.5 ===
</body>
</html>
-
=== Zope/lib/python/StructuredText/regressions/table.ref 1.2 => 1.3 ===
</body>
</html>
-