Hello community, here is the log from the commit of package python-twisted-lore checked in at Mon Apr 21 02:20:16 CEST 2008. -------- --- python-twisted-lore/python-twisted-lore.changes 2007-08-02 17:07:18.000000000 +0200 +++ python-twisted-lore/python-twisted-lore.changes 2008-04-17 19:54:40.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Apr 17 19:54:15 CEST 2008 - matejcik@suse.cz + +- update to 8.0.0 + * new versioning scheme, see python-twisted for explanation + * minor bugfixes + +------------------------------------------------------------------- Old: ---- TwistedLore-0.3.0.tar.bz2 New: ---- TwistedLore-8.0.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-twisted-lore.spec ++++++ --- /var/tmp/diff_new_pack.D16572/_old 2008-04-21 02:19:44.000000000 +0200 +++ /var/tmp/diff_new_pack.D16572/_new 2008-04-21 02:19:44.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package python-twisted-lore (Version 0.3.0) +# spec file for package python-twisted-lore (Version 8.0.0) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -10,16 +10,17 @@ # norootforbuild + Name: python-twisted-lore BuildRequires: python-devel python-twisted Summary: Twisted Lore -Version: 0.3.0 +Version: 8.0.0 Release: 1 %define tarname TwistedLore Source: %{tarname}-%{version}.tar.bz2 License: X11/MIT Group: Development/Languages/Python -URL: http://twistedmatrix.com/trac/wiki/TwistedLore +Url: http://twistedmatrix.com/trac/wiki/TwistedLore BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: python-twisted %{py_requires} @@ -51,19 +52,23 @@ %doc LICENSE README NEWS %changelog -* Thu Aug 02 2007 - jmatejek@suse.cz +* Thu Apr 17 2008 matejcik@suse.cz +- update to 8.0.0 + * new versioning scheme, see python-twisted for explanation + * minor bugfixes +* Thu Aug 02 2007 jmatejek@suse.cz - update to 0.3.0 * improved docstrings * emitting a span with an index class to latex now works -* Thu Oct 26 2006 - jmatejek@suse.cz +* Thu Oct 26 2006 jmatejek@suse.cz - update to 0.2.0 - upgrade to Twisted 2.4 install system - improved docstrings - embedded Dia support for LaTeX no longer needs 'which' - problematic bookify functionality removed -* Tue Feb 28 2006 - jmatejek@suse.cz +* Tue Feb 28 2006 jmatejek@suse.cz - updated to reflect python changes due to #149809 -* Wed Jan 25 2006 - mls@suse.de +* Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Thu Apr 14 2005 - mcihar@suse.cz +* Thu Apr 14 2005 mcihar@suse.cz - new package (split Twisted according to upstream) ++++++ TwistedLore-0.3.0.tar.bz2 -> TwistedLore-8.0.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/doc/examples/index.html new/TwistedLore-8.0.0/doc/examples/index.html --- old/TwistedLore-0.3.0/doc/examples/index.html 2007-01-07 03:42:40.000000000 +0100 +++ new/TwistedLore-8.0.0/doc/examples/index.html 2008-03-25 17:22:43.000000000 +0100 @@ -1,2 +1,2 @@ <?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Twisted Lore examples</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Twisted Lore examples</h1><div class="toc"><ol></ol></div><div class="content"><span></span><ul><li><a href="example.html">example.html</a></li><li><a href="slides-template.tpl">slides-template.tpl</a></li></ul></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 0.3.0</span></body></html> \ No newline at end of file + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Twisted Lore examples</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Twisted Lore examples</h1><div class="toc"><ol></ol></div><div class="content"><span></span><ul><li><a href="example.html">example.html</a></li><li><a href="slides-template.tpl">slides-template.tpl</a></li></ul></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 8.0.0</span></body></html> \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/doc/howto/extend-lore.html new/TwistedLore-8.0.0/doc/howto/extend-lore.html --- old/TwistedLore-0.3.0/doc/howto/extend-lore.html 2007-01-07 03:42:39.000000000 +0100 +++ new/TwistedLore-8.0.0/doc/howto/extend-lore.html 2008-03-25 17:22:43.000000000 +0100 @@ -1,5 +1,5 @@ <?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Extending the Lore Documentation System</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Extending the Lore Documentation System</h1><div class="toc"><ol><li><a href="#auto0">Overview</a></li><li><a href="#auto1">Inputs and Outputs</a></li><ul><li><a href="#auto2">Creating New Inputs</a></li><li><a href="#auto3">Creating New Outputs</a></li></ul><li><a href="#auto4">Other Uses for Lore Extensions</a></li><ul><li><a href="#auto5">Color-Code Programming Languages</a></li><li><a href="#auto6">Add New Structural Elements</a></li><li><a href="#auto7">Support New File Formats</a></li></ul></ol></div><div class="content"><span></span><h2>Overview<a name="auto0"></a></h2><p>The <a href="lore.html">Lore Documentation System</a>, out of the box, is + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Extending the Lore Documentation System</title><link href="stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Extending the Lore Documentation System</h1><div class="toc"><ol><li><a href="#auto0">Overview</a></li><li><a href="#auto1">Inputs and Outputs</a></li><ul><li><a href="#auto2">Creating New Inputs</a></li><li><a href="#auto3">Creating New Outputs</a></li></ul><li><a href="#auto4">Other Uses for Lore Extensions</a></li><ul><li><a href="#auto5">Color-Code Programming Languages</a></li><li><a href="#auto6">Add New Structural Elements</a></li><li><a href="#auto7">Support New File Formats</a></li></ul></ol></div><div class="content"><span></span><h2>Overview<a name="auto0"></a></h2><p>The <a href="lore.html">Lore Documentation System</a>, out of the box, is specialized for documenting Twisted. Its markup includes CSS classes for Python, HTML, filenames, and other Twisted-focused categories. But don't think this means Lore can't be used for other documentation tasks! Lore is @@ -233,4 +233,4 @@ <span class="py-src-keyword">class</span> <span class="py-src-identifier">MyChapterLatexSpitter</span>(<span class="py-src-parameter">MySpitterMixin</span>, <span class="py-src-parameter">latex</span>.<span class="py-src-parameter">ChapterLatexSpitter</span>): <span class="py-src-keyword">pass</span> -</pre><div class="caption">spitters.py - <a href="listings/lore/spitters.py-2"><span class="filename">listings/lore/spitters.py-2</span></a></div></div></li></ul><h3>Creating New Outputs<a name="auto3"></a></h3><p><div class="doit">write some stuff</div></p><h2>Other Uses for Lore Extensions<a name="auto4"></a></h2><p><div class="doit">write some stuff</div></p><h3>Color-Code Programming Languages<a name="auto5"></a></h3><p><div class="doit">write some stuff</div></p><h3>Add New Structural Elements<a name="auto6"></a></h3><p><div class="doit">write some stuff</div></p><h3>Support New File Formats<a name="auto7"></a></h3><p><div class="doit">write some stuff</div></p></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 0.3.0</span></body></html> \ No newline at end of file +</pre><div class="caption">spitters.py - <a href="listings/lore/spitters.py-2"><span class="filename">listings/lore/spitters.py-2</span></a></div></div></li></ul><h3>Creating New Outputs<a name="auto3"></a></h3><p><div class="doit">write some stuff</div></p><h2>Other Uses for Lore Extensions<a name="auto4"></a></h2><p><div class="doit">write some stuff</div></p><h3>Color-Code Programming Languages<a name="auto5"></a></h3><p><div class="doit">write some stuff</div></p><h3>Add New Structural Elements<a name="auto6"></a></h3><p><div class="doit">write some stuff</div></p><h3>Support New File Formats<a name="auto7"></a></h3><p><div class="doit">write some stuff</div></p></div><p><a href="index.html">Index</a></p><span class="version">Version: 8.0.0</span></body></html> \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/doc/howto/index.html new/TwistedLore-8.0.0/doc/howto/index.html --- old/TwistedLore-0.3.0/doc/howto/index.html 2007-01-07 03:42:39.000000000 +0100 +++ new/TwistedLore-8.0.0/doc/howto/index.html 2008-03-25 17:22:43.000000000 +0100 @@ -1,2 +1,2 @@ <?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Twisted Lore Documentation</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Twisted Lore Documentation</h1><div class="toc"><ol></ol></div><div class="content"><span></span><ul class="toc"><li><a href="lore.html">Lore documentation system</a></li><li><a href="extend-lore.html">Extending Lore</a></li></ul></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 0.3.0</span></body></html> \ No newline at end of file + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Twisted Lore Documentation</title><link href="stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Twisted Lore Documentation</h1><div class="toc"><ol></ol></div><div class="content"><span></span><ul class="toc"><li><a href="lore.html">Lore documentation system</a></li><li><a href="extend-lore.html">Extending Lore</a></li></ul></div><p><a href="index.html">Index</a></p><span class="version">Version: 8.0.0</span></body></html> \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/doc/howto/lore.html new/TwistedLore-8.0.0/doc/howto/lore.html --- old/TwistedLore-0.3.0/doc/howto/lore.html 2007-01-07 03:42:40.000000000 +0100 +++ new/TwistedLore-8.0.0/doc/howto/lore.html 2008-03-25 17:22:43.000000000 +0100 @@ -1,5 +1,5 @@ <?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Using the Lore Documentation System</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Using the Lore Documentation System</h1><div class="toc"><ol><li><a href="#auto0">Writing Lore Documents</a></li><ul><li><a href="#auto1">Overview</a></li><li><a href="#auto2">Elements and Their Uses</a></li></ul><li><a href="#auto3">Writing Lore XHTML Templates</a></li><li><a href="#auto4">Using Lore to Generate HTML</a></li><li><a href="#auto5">Using Lore to Generate LaTex</a></li><ul><li><a href="#auto6">Articles</a></li><li><a href="#auto7">Books</a></li></ul><li><a href="#auto8">Using Lore to Generate Slides</a></li><ul><li><a href="#auto9">Magic Point Output</a></li><li><a href="#auto10">LaTeX Output</a></li></ul><li><a href="#auto11">Linting</a></li></ol></div><div class="content"><span></span><h2>Writing Lore Documents<a name="auto0"></a></h2><h3>Overview<a name="auto1"></a></h3><p>Lore documents are a special subset of XHTML documents. They use specific + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Using the Lore Documentation System</title><link href="stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Using the Lore Documentation System</h1><div class="toc"><ol><li><a href="#auto0">Writing Lore Documents</a></li><ul><li><a href="#auto1">Overview</a></li><li><a href="#auto2">Elements and Their Uses</a></li></ul><li><a href="#auto3">Writing Lore XHTML Templates</a></li><li><a href="#auto4">Using Lore to Generate HTML</a></li><li><a href="#auto5">Using Lore to Generate LaTex</a></li><ul><li><a href="#auto6">Articles</a></li><li><a href="#auto7">Books</a></li></ul><li><a href="#auto8">Using Lore to Generate Slides</a></li><ul><li><a href="#auto9">Magic Point Output</a></li><li><a href="#auto10">LaTeX Output</a></li></ul><li><a href="#auto11">Linting</a></li></ol></div><div class="content"><span></span><h2>Writing Lore Documents<a name="auto0"></a></h2><h3>Overview<a name="auto1"></a></h3><p>Lore documents are a special subset of XHTML documents. They use specific subset of XHTML, together with custom classes, to allow a wide variety of document elements, including some Python-specific ones. Lore documents, in particular, are well-formed XML documents. XML can be written using a wide @@ -133,4 +133,4 @@ </pre><p>This will generate compiler-style (file:line:column:message) warnings. It is possible to integrate these warnings into a smart editor such as EMACS, but it has not been done yet.</p><h2>Footnotes</h2><ol><li><a name="footnote-1"><span xmlns="http://www.w3.org/1999/xhtml" class="footnote">See also the -<code>admin/process-docs</code> script.</span></a></li></ol></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 0.3.0</span></body></html> \ No newline at end of file +<code>admin/process-docs</code> script.</span></a></li></ol></div><p><a href="index.html">Index</a></p><span class="version">Version: 8.0.0</span></body></html> \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/doc/man/lore-man.html new/TwistedLore-8.0.0/doc/man/lore-man.html --- old/TwistedLore-0.3.0/doc/man/lore-man.html 1970-01-01 01:00:00.000000000 +0100 +++ new/TwistedLore-8.0.0/doc/man/lore-man.html 2008-03-25 17:22:43.000000000 +0100 @@ -0,0 +1,29 @@ +<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: GENERATELORE.1</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">GENERATELORE.1</h1><div class="toc"><ol><li><a href="#auto0">NAME</a></li><li><a href="#auto1">SYNOPSIS</a></li><li><a href="#auto2">DESCRIPTION</a></li><li><a href="#auto3">DESCRIPTION</a></li><li><a href="#auto4">SEE ALSO</a></li><li><a href="#auto5">AUTHOR</a></li><li><a href="#auto6">REPORTING BUGS</a></li><li><a href="#auto7">COPYRIGHT</a></li></ol></div><div class="content"><span></span><h2>NAME<a name="auto0"></a></h2><p>lore - convert documentations formats +</p><h2>SYNOPSIS<a name="auto1"></a></h2><p><strong>lore</strong> [-l <em>linkrel</em>] [-d <em>docsdir</em>] [-i <em>input</em>] [-o <em>output</em>] [--config attribute[=value] [...]] [-p] [file [...]]</p><p><strong>lore</strong> --help</p><h2>DESCRIPTION<a name="auto2"></a></h2><p>The <strong>--help</strong> prints out a usage message to standard output. +<dl><dt><strong>-p</strong>, <strong>--plain</strong></dt><dd>Use non-flashy progress bar - one file per line. +</dd><dt><strong>-n</strong>, <strong>--null</strong></dt><dd>Do not report progress at all. +</dd><dt><em>-l</em>, <em>--linkrel</em></dt><dd>Where non-document links should be relative to. +</dd><dt><em>-d</em>, <em>--docsdir</em></dt><dd>Where to look for <strong>.html</strong> files if no files are given. +</dd><dt><em>-i</em>, <em>--input</em></dt><dd>Input format. New input formats can be dynamically registered. Lore itself +comes with <q>lore</q> (the standard format), <q>mlore</q> (allows LaTeX equations) +and <q>man</q> (man page format). If the input format is not registered as a plugin, +a module of the named input will be searched. For example, +<strong>--i</strong> twisted.lore.defaultis equivalent to using the default Lore input. +</dd><dt><em>-o</em>, <em>--output</em></dt><dd>Output format. Available output formats depend on the input. For the core +formats, lore and mlore support html, latex and lint, while man allows +lore. +</dd><dt><em>--config</em></dt><dd>Add input/output-specific information. +HTML output allows for 'ext=<extension>', +'template=<template>' and 'baseurl=<format string for API URLs>'. LaTeX +output allows for 'section' or 'chapter' in Lore, and nothing in Math-Lore. +Lore output allows for 'ext=<extension>'. Lint output allows nothing. +Note that disallowed <em>--config</em> options are merely ignored, and do +not cause errors. +</dd></dl></p><h2>DESCRIPTION<a name="auto3"></a></h2><p>If no files are given, all *.html documents in docsdir are processed. +</p><h2>SEE ALSO<a name="auto4"></a></h2><p>doc/howto/lore.xhtml, doc/howto/doc-standard.xhtml, doc/howto/extend-lore.xhtml +</p><h2>AUTHOR<a name="auto5"></a></h2><p>Written by Moshe Zadka +</p><h2>REPORTING BUGS<a name="auto6"></a></h2><p>To report a bug, visit <em>http://twistedmatrix.com/bugs/</em></p><h2>COPYRIGHT<a name="auto7"></a></h2><p>Copyright © 2003 Matthew W. Lefkowitz +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +</p></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 8.0.0</span></body></html> \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/LICENSE new/TwistedLore-8.0.0/LICENSE --- old/TwistedLore-0.3.0/LICENSE 2006-06-03 22:59:55.000000000 +0200 +++ new/TwistedLore-8.0.0/LICENSE 2008-03-25 17:06:58.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2001-2006 +Copyright (c) 2001-2008 Allen Short Andrew Bennetts Apple Computer, Inc. @@ -15,7 +15,7 @@ Jonathan Lange Jonathan D. Simms Jp Calderone -J�rgen Hermann +Jürgen Hermann Kevin Turner Mary Gardiner Matthew Lefkowitz @@ -26,6 +26,10 @@ Ralph Meijer Sean Riley Travis B. Hartwell +Thomas Herve +Eyal Lotem +Antoine Pitrou +Andy Gayton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/NEWS new/TwistedLore-8.0.0/NEWS --- old/TwistedLore-0.3.0/NEWS 2007-01-06 23:24:26.000000000 +0100 +++ new/TwistedLore-8.0.0/NEWS 2008-03-25 17:18:51.000000000 +0100 @@ -1,3 +1,20 @@ +8.0.0 (2008-03-17) +================== + +Fixes +----- + - Change twisted.lore.tree.setIndexLin so that it removes node with index-link + class when the specified index filename is None. (#812) + - Fix the conversion of the list of options in man pages to Lore format. + (#3017) + - Fix conch man pages generation. (#3075) + - Fix management of the interactive command tag in man2lore. (#3076) + +Misc +---- + - #2847 + + 0.3.0 (2007-01-06) ================== diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/README new/TwistedLore-8.0.0/README --- old/TwistedLore-0.3.0/README 2007-01-06 23:21:41.000000000 +0100 +++ new/TwistedLore-8.0.0/README 2008-03-25 17:13:14.000000000 +0100 @@ -1,3 +1,3 @@ -Twisted Lore 0.3.0 +Twisted Lore 8.0.0 Twisted Lore depends on Twisted and Twisted Web. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/man2lore.py new/TwistedLore-8.0.0/twisted/lore/man2lore.py --- old/TwistedLore-0.3.0/twisted/lore/man2lore.py 2004-08-25 10:36:30.000000000 +0200 +++ new/TwistedLore-8.0.0/twisted/lore/man2lore.py 2008-03-17 14:20:22.000000000 +0100 @@ -1,28 +1,51 @@ -# Copyright (c) 2001-2004 Twisted Matrix Laboratories. +# -*- test-case-name: twisted.lore.test.test_man2lore -*- +# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. -# -"""man2lore: Converts man page source (i.e. groff) into lore-compatible html. + +""" +man2lore: Converts man page source (i.e. groff) into lore-compatible html. This is nasty and hackish (and doesn't support lots of real groff), but is good enough for converting fairly simple man pages. """ -from __future__ import nested_scopes import re, os + quoteRE = re.compile('"(.*?)"') + + def escape(text): text = text.replace('<', '<').replace('>', '>') text = quoteRE.sub('<q>\\1</q>', text) return text + + def stripQuotes(s): if s[0] == s[-1] == '"': s = s[1:-1] return s -class ManConverter: + + +class ManConverter(object): + """ + Convert a man page to the Lore format. + + @ivar tp: State variable for handling text inside a C{TP} token. It can + take values from 0 to 3: + - 0: when outside of a C{TP} token. + - 1: once a C{TP} token has been encountered. If the previous value + was 0, a definition list is started. Then, at the first line of + text, a definition term is started. + - 2: when the first line after the C{TP} token has been handled. + The definition term is closed, and a definition is started with + the next line of text. + - 3: when the first line as definition data has been handled. + @type tp: C{int} + """ state = 'regular' name = None tp = 0 @@ -43,6 +66,7 @@ self.closeTags() self.write('</body>\n</html>\n') + def lineReceived(self, line): if line[0] == '.': f = getattr(self, 'macro_' + line[1:3].rstrip().upper(), None) @@ -51,6 +75,7 @@ else: self.text(line) + def continueReceived(self, cont): if not cont: return @@ -61,6 +86,7 @@ else: self.text(cont) + def closeTags(self): if self.state != 'regular': self.write('%s>' % self.state) @@ -74,11 +100,13 @@ self.write('</p>\n\n') self.para = 0 + def paraCheck(self): if not self.tp and not self.para: self.write('<p>') self.para = 1 + def macro_TH(self, line): self.write('<html><head>\n') parts = [stripQuotes(x) for x in line.split(' ', 2)] + ['', ''] @@ -86,9 +114,10 @@ self.write('<title>%s.%s</title>' % (title, manSection)) self.write('</head>\n<body>\n\n') self.write('<h1>%s.%s</h1>\n\n' % (title, manSection)) - + macro_DT = macro_TH - + + def macro_SH(self, line): self.closeTags() self.write('<h2>') @@ -98,16 +127,19 @@ self.closeTags() self.write('</h2>\n\n') + def macro_B(self, line): words = line.split() words[0] = '\\fB' + words[0] + '\\fR ' self.text(' '.join(words)) + def macro_NM(self, line): if not self.name: self.name = line self.text(self.name + ' ') + def macro_NS(self, line): parts = line.split(' Ns ') i = 0 @@ -118,61 +150,95 @@ else: self.continueReceived(l) + def macro_OO(self, line): self.text('[') self.continueReceived(line) + def macro_OC(self, line): self.text(']') self.continueReceived(line) + def macro_OP(self, line): self.text('[') self.continueReceived(line) self.text(']') + def macro_FL(self, line): parts = line.split() self.text('\\fB-%s\\fR' % parts[0]) self.continueReceived(' '.join(parts[1:])) + def macro_AR(self, line): parts = line.split() self.text('\\fI %s\\fR' % parts[0]) self.continueReceived(' '.join(parts[1:])) + def macro_PP(self, line): self.closeTags() + + def macro_IC(self, line): + cmd = line.split(' ', 1)[0] + args = line[line.index(cmd) + len(cmd):] + args = args.split(' ') + text = cmd + while args: + arg = args.pop(0) + if arg.lower() == "ar": + text += " \\fU%s\\fR" % (args.pop(0),) + elif arg.lower() == "op": + ign = args.pop(0) + text += " [\\fU%s\\fR]" % (args.pop(0),) + + self.text(text) + + def macro_TP(self, line): + """ + Handle C{TP} token: start a definition list if it's first token, or + close previous definition data. + """ if self.tp == 3: self.write('</dd>\n\n') - self.tp = 1 + self.tp = 1 + else: + self.tp = 1 + self.write('<dl>') + self.dl = 1 + def macro_BL(self, line): - #assert self.tp == 0, self.tp self.write('<dl>') self.tp = 1 + def macro_EL(self, line): if self.tp == 3: self.write('</dd>') self.tp = 1 - #assert self.tp == 1, self.tp self.write('</dl>\n\n') self.tp = 0 + def macro_IT(self, line): if self.tp == 3: self.write('</dd>') self.tp = 1 - #assert self.tp == 1, (self.tp, line) - self.write('\n<dt>') self.continueReceived(line) - self.write('</dt>') - self.tp = 2 + def text(self, line): + """ + Handle a line of text without detected token. + """ + if self.tp == 1: + self.write('<dt>') if self.tp == 2: self.write('<dd>') self.paraCheck() @@ -190,14 +256,24 @@ self.write('%s>' % self.state) self.write(escape(bit[2:])) self.state = 'regular' + elif bit[:2] == 'fU': + # fU doesn't really exist, but it helps us to manage underlined + # text. + self.write('<u>' + escape(bit[2:])) + self.state = 'u' elif bit[:3] == '(co': self.write('©' + escape(bit[3:])) else: self.write(escape(bit)) - if self.tp == 2: + if self.tp == 1: + self.write('</dt>') + self.tp = 2 + elif self.tp == 2: self.tp = 3 + + class ProcessingFunctionFactory: def generate_lore(self, d, filenameGenerator=None): @@ -205,8 +281,11 @@ return lambda file,_: ManConverter().convert(open(file), open(os.path.splitext(file)[0]+ext, 'w')) + + factory = ProcessingFunctionFactory() + if __name__ == '__main__': import sys mc = ManConverter().convert(open(sys.argv[1]), sys.stdout) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/nevowlore.py new/TwistedLore-8.0.0/twisted/lore/nevowlore.py --- old/TwistedLore-0.3.0/twisted/lore/nevowlore.py 2006-04-10 05:21:33.000000000 +0200 +++ new/TwistedLore-8.0.0/twisted/lore/nevowlore.py 2008-03-04 22:36:22.000000000 +0100 @@ -14,8 +14,6 @@ lore -inevow --config pageclass=some.module.SomePageSubclass [other-opts] -API Stability: unstable - Maintainer: U{Christopher Armstrongmailto:radix@twistedmatrix.com} """ Files old/TwistedLore-0.3.0/twisted/lore/scripts/__init__.pyc and new/TwistedLore-8.0.0/twisted/lore/scripts/__init__.pyc differ Files old/TwistedLore-0.3.0/twisted/lore/scripts/lore.pyc and new/TwistedLore-8.0.0/twisted/lore/scripts/lore.pyc differ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/test/test_lore.py new/TwistedLore-8.0.0/twisted/lore/test/test_lore.py --- old/TwistedLore-0.3.0/twisted/lore/test/test_lore.py 2006-10-09 22:36:38.000000000 +0200 +++ new/TwistedLore-8.0.0/twisted/lore/test/test_lore.py 2007-06-23 21:58:31.000000000 +0200 @@ -14,26 +14,26 @@ # ++ multiple entries added to index # ++ multiple index entries pointing to correct files and anchors # __ all of above for files in deep directory structure -# +# # ++ group index entries by indexed term # ++ sort index entries by indexed term # __ hierarchical index entries (e.g. language!programming) -# +# # ++ add parameter for what the index filename should be # ++ add (default) ability to NOT index (if index not specified) -# +# # ++ put actual index filename into INDEX link (if any) in the template # __ make index links RELATIVE! # __ make index pay attention to the outputdir! -# +# # __ make index look nice # # ++ add section numbers to headers in lore output # ++ make text of index entry links be chapter numbers # ++ make text of index entry links be section numbers -# +# # __ put all of our test files someplace neat and tidy -# +# import os, shutil from StringIO import StringIO @@ -48,7 +48,7 @@ from twisted.lore.scripts import lore -from twisted.web import microdom +from twisted.web import microdom, domhelpers def sp(originalFileName): return sibpath(__file__, originalFileName) @@ -158,15 +158,15 @@ normp = os.path.normpath; join = os.path.join inputdir = normp(join("/", 'home', 'joe')) outputdir = normp(join("/", 'away', 'joseph')) - actual = process.outputdirGenerator(join("/", 'home', 'joe', "myfile.html"), + actual = process.outputdirGenerator(join("/", 'home', 'joe', "myfile.html"), '.xhtml', inputdir, outputdir) expected = normp(join("/", 'away', 'joseph', 'myfile.xhtml')) self.assertEquals(expected, actual) - + def test_outputdirGeneratorBadInput(self): options = {'outputdir': '/away/joseph/', 'inputdir': '/home/joe/' } self.assertRaises(ValueError, process.outputdirGenerator, '.html', '.xhtml', **options) - + def test_makeSureDirectoryExists(self): dirname = os.path.join("tmp", 'nonexistentdir') if os.path.exists(dirname): @@ -205,7 +205,7 @@ bf.close() book = htmlbook.Book(bookFilename) - expected = {'indexFilename': None, + expected = {'indexFilename': None, 'chapters': [(inputFilename, None)], } dct = book.__dict__ @@ -281,11 +281,60 @@ self.assertEquals(None, result) #self.assertEqualFiles1("lore_index_file_out_multiple.html", indexFilename + ".tns") - # VVV change to new, numbered files + # VVV change to new, numbered files self.assertEqualFiles("lore_numbering_test_out.html", "lore_numbering_test.tns") self.assertEqualFiles("lore_numbering_test_out2.html", "lore_numbering_test2.tns") + def test_setIndexLink(self): + """ + Tests to make sure that index links are processed when an index page + exists and removed when there is not. + """ + templ = microdom.parse(open(d['template'])) + indexFilename = 'theIndexFile' + numLinks = len(domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + + # if our testing template has no index-link nodes, complain about it + self.assertNotEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + + tree.setIndexLink(templ, indexFilename) + + self.assertEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + + indexLinks = domhelpers.findElementsWithAttribute(templ, + "href", + indexFilename) + self.assertTrue(len(indexLinks) >= numLinks) + + templ = microdom.parse(open(d['template'])) + self.assertNotEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + indexFilename = None + + tree.setIndexLink(templ, indexFilename) + + self.assertEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + + + class LatexSpitterTestCase(unittest.TestCase): """ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/test/test_man2lore.py new/TwistedLore-8.0.0/twisted/lore/test/test_man2lore.py --- old/TwistedLore-0.3.0/twisted/lore/test/test_man2lore.py 1970-01-01 01:00:00.000000000 +0100 +++ new/TwistedLore-8.0.0/twisted/lore/test/test_man2lore.py 2008-03-17 14:20:22.000000000 +0100 @@ -0,0 +1,162 @@ +# Copyright (c) 2008 Twisted Matrix Laboratories. +# See LICENSE for details. + + +""" +Tests for L{twisted.lore.man2lore}. +""" + +from StringIO import StringIO + +from twisted.trial.unittest import TestCase + +from twisted.lore.man2lore import ManConverter + + + +class ManConverterTestCase(TestCase): + """ + Tests for L{ManConverter}. + """ + + def setUp(self): + """ + Build instance variables useful for tests. + + @ivar converter: a L{ManConverter} to be used during tests. + """ + self.converter = ManConverter() + + + def assertConvert(self, inputLines, expectedOutput): + """ + Helper method to check conversion from a man page to a Lore output. + + @param inputLines: lines of the manpages. + @type inputLines: C{list} + + @param expectedOutput: expected Lore content. + @type expectedOutput: C{str} + """ + inputFile = StringIO() + for line in inputLines: + inputFile.write(line + '\n') + inputFile.seek(0) + outputFile = StringIO() + self.converter.convert(inputFile, outputFile) + self.assertEquals(outputFile.getvalue(), expectedOutput) + + + def test_convert(self): + """ + Test convert on a minimal example. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', "Foo\n"] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<p>Foo\n\n</p>\n\n</body>\n</html>\n") + self.assertConvert(inputLines, output) + + + def test_TP(self): + """ + Test C{TP} parsing. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".TP", + "\\fB-o\\fR, \\fB--option\\fR", + "An option"] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<h2>HEADER</h2>\n\n<dl><dt>" + "<strong>-o</strong>, <strong>--option</strong>\n</dt>" + "<dd>An option\n</dd>\n\n</dl>\n\n</body>\n</html>\n") + self.assertConvert(inputLines, output) + + + def test_TPMultipleOptions(self): + """ + Try to parse multiple C{TP} fields. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".TP", + "\\fB-o\\fR, \\fB--option\\fR", + "An option", + ".TP", + "\\fB-n\\fR, \\fB--another\\fR", + "Another option", + ] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<h2>HEADER</h2>\n\n<dl><dt>" + "<strong>-o</strong>, <strong>--option</strong>\n</dt>" + "<dd>An option\n</dd>\n\n<dt>" + "<strong>-n</strong>, <strong>--another</strong>\n</dt>" + "<dd>Another option\n</dd>\n\n</dl>\n\n</body>\n</html>\n") + self.assertConvert(inputLines, output) + + + def test_TPMultiLineOptions(self): + """ + Try to parse multiple C{TP} fields, with options text on several lines. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".TP", + "\\fB-o\\fR, \\fB--option\\fR", + "An option", + "on two lines", + ".TP", + "\\fB-n\\fR, \\fB--another\\fR", + "Another option", + "on two lines", + ] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<h2>HEADER</h2>\n\n<dl><dt>" + "<strong>-o</strong>, <strong>--option</strong>\n</dt>" + "<dd>An option\non two lines\n</dd>\n\n" + "<dt><strong>-n</strong>, <strong>--another</strong>\n</dt>" + "<dd>Another option\non two lines\n</dd>\n\n</dl>\n\n" + "</body>\n</html>\n") + self.assertConvert(inputLines, output) + + + def test_ITLegacyManagement(self): + """ + Test management of BL/IT/EL used in some man pages. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".BL", + ".IT An option", + "on two lines", + ".IT", + "Another option", + "on two lines", + ".EL" + ] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<h2>HEADER</h2>\n\n<dl>" + "<dt>on two lines\n</dt><dd>Another option\non two lines\n" + "</dd></dl>\n\n</body>\n</html>\n") + self.assertConvert(inputLines, output) + + + def test_interactiveCommand(self): + """ + Test management of interactive command tag. + """ + inputLines = ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".BL", + ".IT IC foo AR bar", + "option 1", + ".IT IC egg AR spam OP AR stuff", + "option 2", + ".EL" + ] + output = ("<html><head>\n<title>BAR.1</title></head>\n<body>\n\n" + "<h1>BAR.1</h1>\n\n<h2>HEADER</h2>\n\n<dl>" + "<dt>foo <u>bar</u></dt><dd>option 1\n</dd><dt>egg " + "<u>spam</u> [<u>stuff</u>]</dt><dd>option 2\n</dd></dl>" + "\n\n</body>\n</html>\n") + self.assertConvert(inputLines, output) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/tree.py new/TwistedLore-8.0.0/twisted/lore/tree.py --- old/TwistedLore-0.3.0/twisted/lore/tree.py 2006-12-20 02:46:43.000000000 +0100 +++ new/TwistedLore-8.0.0/twisted/lore/tree.py 2007-06-23 21:58:31.000000000 +0200 @@ -551,16 +551,19 @@ @type indexFilename: C{str} @param indexFilename: The address of the index document to which to link. - If any C{False} value, this function will do nothing. + If any C{False} value, this function will remove all index-link nodes. @return: C{None} """ - if not indexFilename: - return - indexLinks = domhelpers.findElementsWithAttribute(template, "class", "index-link") + indexLinks = domhelpers.findElementsWithAttribute(template, + "class", + "index-link") for link in indexLinks: - link.nodeName = link.tagName = link.endTagName = 'a' - link.attributes = InsensitiveDict({'href': indexFilename}) + if indexFilename is None: + link.parentNode.removeChild(link) + else: + link.nodeName = link.tagName = link.endTagName = 'a' + link.attributes = InsensitiveDict({'href': indexFilename}) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/TwistedLore-0.3.0/twisted/lore/_version.py new/TwistedLore-8.0.0/twisted/lore/_version.py --- old/TwistedLore-0.3.0/twisted/lore/_version.py 2007-01-06 23:21:41.000000000 +0100 +++ new/TwistedLore-8.0.0/twisted/lore/_version.py 2008-03-25 17:13:14.000000000 +0100 @@ -1,3 +1,3 @@ -# This is an auto-generated file. Use admin/change-versions to update. +# This is an auto-generated file. Do not edit it. from twisted.python import versions -version = versions.Version(__name__[:__name__.rfind('.')], 0, 3, 0) +version = versions.Version('twisted.lore', 8, 0, 0) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org