From root@Hilbert.suse.de Mon Apr 21 00:16:59 2008 From: root@Hilbert.suse.de To: commit@lists.opensuse.org Subject: commit python-twisted-lore Date: Mon, 21 Apr 2008 02:20:16 +0200 Message-ID: <20080421002016.D4F0C678182@Hilbert.suse.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8308710990830102172==" --===============8308710990830102172== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.00000= 0000 +0200 +++ python-twisted-lore/python-twisted-lore.changes 2008-04-17 19:54:40.00000= 0000 +0200 @@ -1,0 +2,7 @@ +Thu Apr 17 19:54:15 CEST 2008 - matejcik(a)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 @@ =20 # norootforbuild =20 + 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 =20 %changelog -* Thu Aug 02 2007 - jmatejek(a)suse.cz +* Thu Apr 17 2008 matejcik(a)suse.cz +- update to 8.0.0 + * new versioning scheme, see python-twisted for explanation + * minor bugfixes +* Thu Aug 02 2007 jmatejek(a)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(a)suse.cz +* Thu Oct 26 2006 jmatejek(a)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(a)suse.cz +* Tue Feb 28 2006 jmatejek(a)suse.cz - updated to reflect python changes due to #149809 -* Wed Jan 25 2006 - mls(a)suse.de +* Wed Jan 25 2006 mls(a)suse.de - converted neededforbuild to BuildRequires -* Thu Apr 14 2005 - mcihar(a)suse.cz +* Thu Apr 14 2005 mcihar(a)suse.cz - new package (split Twisted according to upstream) ++++++ TwistedLore-0.3.0.tar.bz2 -> TwistedLore-8.0.0.tar.bz2 ++++++ diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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.0000000= 00 +0100 +++ new/TwistedLore-8.0.0/doc/examples/index.html 2008-03-25 17:22:43.0000000= 00 +0100 @@ -1,2 +1,2 @@ Twisted Documentation= : Twisted Lore examples

Twisted Lore examples

    Index

    Vers= ion: 0.3.0 \ No newline at end of file + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Twisted Documentation= : Twisted Lore examples

    Twisted Lore examples

      Index

      Vers= ion: 8.0.0 \ No newline at end of file diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.svnignore old/TwistedLore-0.3.0/doc/howto/extend-lore.html new/TwistedLor= e-8.0.0/doc/howto/extend-lore.html --- old/TwistedLore-0.3.0/doc/howto/extend-lore.html 2007-01-07 03:42:39.0000= 00000 +0100 +++ new/TwistedLore-8.0.0/doc/howto/extend-lore.html 2008-03-25 17:22:43.0000= 00000 +0100 @@ -1,5 +1,5 @@ Twisted Documentation= : Extending the Lore Documentation System

      Extending the Lore Documentation System

      1. Overview
      2. = Inputs and Outputs
      3. Other Uses for Lore Extensions

      Overview

      The Lore Documentation System, out = of the box, is + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Twisted Documentation= : Extending the Lore Documentation System

      Extending the Lore Documentation System

      Overview<= /h2>

      The Lore Documentation System, out of the bo= x, 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 @@ =20 class MyChapterLatexSpitter(MySpitterMixi= n, latex.ChapterLatexSpitter): pass -

      <= /div>

      Creating New Outputs

      write some stuff

      Other Uses for Lore Extensions

      write some stuff

      Co= lor-Code Programming Languages

      write some stuff

      Add New Structural Elements

      write some stuff

      Support New Fi= le Formats

      write some stuff<= /div>

      Index

      Version: 0.3.0 \ No newline at end of file +<= /div>

      Creating New Outputs

      write some stuff

      Other Uses for Lore Extensions

      write some stuff

      Co= lor-Code Programming Languages

      write some stuff

      Add New Structural Elements

      write some stuff

      Support New Fi= le Formats

      write some stuff<= /div>

      Index

      Version: 8.0.0 \ No newline at end of file diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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 @@ Twisted Documentation= : Twisted Lore Documentation

      Twisted Lore Documentation

        <= div class=3D"content">

        Index

        Version: 0.3.0 \ No newline at end of file + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Twisted Documentation= : Twisted Lore Documentation

        Twisted Lore Documentation

          Index

          Version: 8.0.0 \ No newline at end of file diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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 @@ Twisted Documentation= : Using the Lore Documentation System=

          Using the Lore Documentation System

          Writin= g Lore Documents

          Overview=

          Lore documents are a special subset of XHTML documents. They use spec= ific + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Twisted Documentation= : Using the Lore Documentation System

          Using the Lore Documentation System

          Writing Lore Docu= ments

          Overview

          Lor= e 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 @@

          This will generate compiler-style (file:line:column:message) warnin= gs. It is possible to integrate these warnings into a smart editor such as EMACS, but it has not been done yet.

          Footnotes

          1. = See also the -admin/process-docs script.

          Index

          Version: 0.3.0<= /span> \ No newline at end of file +admin/process-docs script.

          Index

          Version: 8.0.0 \ No newline at end of file diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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 @@ +Twisted Documentation= : GENERATELORE.1

          G= ENERATELORE.1

          NAME

          lore - co= nvert documentations formats +

          SYNOPSIS

          lore [-l linkrel] [-d docsdir] [-i input] [-o output]= [--config attribute[=3Dvalue] [...]] [-p] [file [...]]

          lore --help

          DESCRIPTION

          The --= help prints out a usage message to standard output. +

          -p, --plain
          Use non-flashy= progress bar - one file per line. +
          -n, --null
          Do not report = progress at all. +
          -l, --linkrel
          Where non-document links sh= ould be relative to. +
          -d, --docsdir
          Where to look for .= html files if no files are given. +
          -i, --input
          Input format. New input forma= ts can be dynamically registered. Lore itself +comes with lore (the standard format), mlore (allows LaTeX equ= ations) +and man (man page format). If the input format is not registered as a= plugin, +a module of the named input will be searched. For example,=20 +--i twisted.lore.defaultis equivalent to using the default= Lore input. +
          -o, --output
          Output format. Available out= put formats depend on the input. For the core +formats, lore and mlore support html, latex and lint, while man allows +lore. +
          --config
          Add input/output-specific information.=20 +HTML output allows for 'ext=3D<extension>', +'template=3D<template>' and 'baseurl=3D<format string for API URLs&= gt;'. LaTeX +output allows for 'section' or 'chapter' in Lore, and nothing in Math-Lore. = +Lore output allows for 'ext=3D<extension>'. Lint output allows nothing. +Note that disallowed --config options are merely ignored, and do +not cause errors. +

          DESCRIPTION

          If no files are g= iven, all *.html documents in docsdir are processed. +

          SEE ALSO

          doc/howto/lore.xhtml, doc/howt= o/doc-standard.xhtml, doc/howto/extend-lore.xhtml +

          AUTHOR

          Written by Moshe Zadka +

          REPORTING BUGS

          To report a bug, visit <= em>http://twistedmatrix.com/bugs/

          COPYRIGHT=

          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. +

          Index

          Version: 8.0.0 \ No newline at end of file diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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=EF=BF=BDrgen Hermann +J=C3=BCrgen 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 =20 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Fixes +----- + - Change twisted.lore.tree.setIndexLin so that it removes node with index-l= ink + 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) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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 =20 Twisted Lore depends on Twisted and Twisted Web. diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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.000000= 000 +0200 +++ new/TwistedLore-8.0.0/twisted/lore/man2lore.py 2008-03-17 14:20:22.000000= 000 +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. =20 -# -"""man2lore: Converts man page source (i.e. groff) into lore-compatible html. + +""" +man2lore: Converts man page source (i.e. groff) into lore-compatible html. =20 This is nasty and hackish (and doesn't support lots of real groff), but is g= ood enough for converting fairly simple man pages. """ -from __future__ import nested_scopes =20 import re, os + quoteRE =3D re.compile('"(.*?)"') =20 + + def escape(text): text =3D text.replace('<', '<').replace('>', '>') text =3D quoteRE.sub('\\1', text) return text =20 + + def stripQuotes(s): if s[0] =3D=3D s[-1] =3D=3D '"': s =3D s[1:-1] return s =20 -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 va= lue + 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 =3D 'regular' name =3D None tp =3D 0 @@ -43,6 +66,7 @@ self.closeTags() self.write('\n\n') =20 + def lineReceived(self, line): if line[0] =3D=3D '.': f =3D getattr(self, 'macro_' + line[1:3].rstrip().upper(), None) @@ -51,6 +75,7 @@ else: self.text(line) =20 + def continueReceived(self, cont): if not cont: return @@ -61,6 +86,7 @@ else: self.text(cont) =20 + def closeTags(self): if self.state !=3D 'regular': self.write('' % self.state) @@ -74,11 +100,13 @@ self.write('

          \n\n') self.para =3D 0 =20 + def paraCheck(self): if not self.tp and not self.para: self.write('

          ') self.para =3D 1 =20 + def macro_TH(self, line): self.write('\n') parts =3D [stripQuotes(x) for x in line.split(' ', 2)] + ['', ''] @@ -86,9 +114,10 @@ self.write('%s.%s' % (title, manSection)) self.write('\n\n\n') self.write('

          %s.%s

          \n\n' % (title, manSection)) - =20 + macro_DT =3D macro_TH - =20 + + def macro_SH(self, line): self.closeTags() self.write('

          ') @@ -98,16 +127,19 @@ self.closeTags() self.write('

          \n\n') =20 + def macro_B(self, line): words =3D line.split() words[0] =3D '\\fB' + words[0] + '\\fR ' self.text(' '.join(words)) =20 + def macro_NM(self, line): if not self.name: self.name =3D line self.text(self.name + ' ') =20 + def macro_NS(self, line): parts =3D line.split(' Ns ') i =3D 0 @@ -118,61 +150,95 @@ else: self.continueReceived(l) =20 + def macro_OO(self, line): self.text('[') self.continueReceived(line) =20 + def macro_OC(self, line): self.text(']') self.continueReceived(line) =20 + def macro_OP(self, line): self.text('[') self.continueReceived(line) self.text(']') =20 + def macro_FL(self, line): parts =3D line.split() self.text('\\fB-%s\\fR' % parts[0]) self.continueReceived(' '.join(parts[1:])) =20 + def macro_AR(self, line): parts =3D line.split() self.text('\\fI %s\\fR' % parts[0]) self.continueReceived(' '.join(parts[1:])) =20 + def macro_PP(self, line): self.closeTags() =20 + + def macro_IC(self, line): + cmd =3D line.split(' ', 1)[0] + args =3D line[line.index(cmd) + len(cmd):] + args =3D args.split(' ') + text =3D cmd + while args: + arg =3D args.pop(0) + if arg.lower() =3D=3D "ar": + text +=3D " \\fU%s\\fR" % (args.pop(0),) + elif arg.lower() =3D=3D "op": + ign =3D args.pop(0) + text +=3D " [\\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 =3D=3D 3: self.write('\n\n') - self.tp =3D 1 + self.tp =3D 1 + else: + self.tp =3D 1 + self.write('
          ') + self.dl =3D 1 + =20 def macro_BL(self, line): - #assert self.tp =3D=3D 0, self.tp self.write('
          ') self.tp =3D 1 =20 + def macro_EL(self, line): if self.tp =3D=3D 3: self.write('') self.tp =3D 1 - #assert self.tp =3D=3D 1, self.tp self.write('
          \n\n') self.tp =3D 0 =20 + def macro_IT(self, line): if self.tp =3D=3D 3: self.write('') self.tp =3D 1 - #assert self.tp =3D=3D 1, (self.tp, line) - self.write('\n
          ') self.continueReceived(line) - self.write('
          ') - self.tp =3D 2 + =20 def text(self, line): + """ + Handle a line of text without detected token. + """ + if self.tp =3D=3D 1: + self.write('
          ') if self.tp =3D=3D 2: self.write('
          ') self.paraCheck() @@ -190,14 +256,24 @@ self.write('' % self.state) self.write(escape(bit[2:])) self.state =3D 'regular' + elif bit[:2] =3D=3D 'fU': + # fU doesn't really exist, but it helps us to manage underli= ned + # text. + self.write('' + escape(bit[2:])) + self.state =3D 'u' elif bit[:3] =3D=3D '(co': self.write('©' + escape(bit[3:])) else: self.write(escape(bit)) =20 - if self.tp =3D=3D 2: + if self.tp =3D=3D 1: + self.write('') + self.tp =3D 2 + elif self.tp =3D=3D 2: self.tp =3D 3 =20 + + class ProcessingFunctionFactory: =20 def generate_lore(self, d, filenameGenerator=3DNone): @@ -205,8 +281,11 @@ return lambda file,_: ManConverter().convert(open(file), open(os.path.splitext(file)[0]+ext, 'w')) =20 + + factory =3D ProcessingFunctionFactory() =20 + if __name__ =3D=3D '__main__': import sys mc =3D ManConverter().convert(open(sys.argv[1]), sys.stdout) diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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.00000= 0000 +0200 +++ new/TwistedLore-8.0.0/twisted/lore/nevowlore.py 2008-03-04 22:36:22.00000= 0000 +0100 @@ -14,8 +14,6 @@ =20 lore -inevow --config pageclass=3Dsome.module.SomePageSubclass [other-opts] =20 -API Stability: unstable - Maintainer: U{Christopher Armstrong} =20 """ Files old/TwistedLore-0.3.0/twisted/lore/scripts/__init__.pyc and new/Twisted= Lore-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=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.svnignore old/TwistedLore-0.3.0/twisted/lore/test/test_lore.py new/Twiste= dLore-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 -#=20 +# # ++ group index entries by indexed term # ++ sort index entries by indexed term # __ hierarchical index entries (e.g. language!programming) -#=20 +# # ++ add parameter for what the index filename should be # ++ add (default) ability to NOT index (if index not specified) -#=20 +# # ++ put actual index filename into INDEX link (if any) in the template # __ make index links RELATIVE! # __ make index pay attention to the outputdir! -#=20 +# # __ 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 -#=20 +# # __ put all of our test files someplace neat and tidy -#=20 +# =20 import os, shutil from StringIO import StringIO @@ -48,7 +48,7 @@ =20 from twisted.lore.scripts import lore =20 -from twisted.web import microdom +from twisted.web import microdom, domhelpers =20 def sp(originalFileName): return sibpath(__file__, originalFileName) @@ -158,15 +158,15 @@ normp =3D os.path.normpath; join =3D os.path.join inputdir =3D normp(join("/", 'home', 'joe')) outputdir =3D normp(join("/", 'away', 'joseph')) - actual =3D process.outputdirGenerator(join("/", 'home', 'joe', "myfi= le.html"),=20 + actual =3D process.outputdirGenerator(join("/", 'home', 'joe', "myfi= le.html"), '.xhtml', inputdir, outputdir) expected =3D normp(join("/", 'away', 'joseph', 'myfile.xhtml')) self.assertEquals(expected, actual) - =20 + def test_outputdirGeneratorBadInput(self): options =3D {'outputdir': '/away/joseph/', 'inputdir': '/home/joe/' } self.assertRaises(ValueError, process.outputdirGenerator, '.html', '= .xhtml', **options) - =20 + def test_makeSureDirectoryExists(self): dirname =3D os.path.join("tmp", 'nonexistentdir') if os.path.exists(dirname): @@ -205,7 +205,7 @@ bf.close() =20 book =3D htmlbook.Book(bookFilename) - expected =3D {'indexFilename': None,=20 + expected =3D {'indexFilename': None, 'chapters': [(inputFilename, None)], } dct =3D book.__dict__ @@ -281,11 +281,60 @@ =20 self.assertEquals(None, result) #self.assertEqualFiles1("lore_index_file_out_multiple.html", indexFi= lename + ".tns") - # VVV change to new, numbered files =20 + # VVV change to new, numbered files self.assertEqualFiles("lore_numbering_test_out.html", "lore_numberin= g_test.tns") self.assertEqualFiles("lore_numbering_test_out2.html", "lore_numberi= ng_test2.tns") =20 =20 + 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 =3D microdom.parse(open(d['template'])) + indexFilename =3D 'theIndexFile' + numLinks =3D 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 =3D domhelpers.findElementsWithAttribute(templ, + "href", + indexFilename) + self.assertTrue(len(indexLinks) >=3D numLinks) + + templ =3D microdom.parse(open(d['template'])) + self.assertNotEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + indexFilename =3D None + + tree.setIndexLink(templ, indexFilename) + + self.assertEquals( + [], + domhelpers.findElementsWithAttribute(templ, + "class", + "index-link")) + + + =20 class LatexSpitterTestCase(unittest.TestCase): """ diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.svnignore old/TwistedLore-0.3.0/twisted/lore/test/test_man2lore.py new/Tw= istedLore-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 =3D 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 =3D StringIO() + for line in inputLines: + inputFile.write(line + '\n') + inputFile.seek(0) + outputFile =3D StringIO() + self.converter.convert(inputFile, outputFile) + self.assertEquals(outputFile.getvalue(), expectedOutput) + + + def test_convert(self): + """ + Test convert on a minimal example. + """ + inputLines =3D ['.TH BAR "1" "Oct 2007" "" ""', "Foo\n"] + output =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          Foo\n\n

          \n\n\n\n") + self.assertConvert(inputLines, output) + + + def test_TP(self): + """ + Test C{TP} parsing. + """ + inputLines =3D ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".TP", + "\\fB-o\\fR, \\fB--option\\fR", + "An option"] + output =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          HEADER

          \n\n
          " + "-o, --option\n
          " + "
          An option\n
          \n\n
          \n\n\n\n") + self.assertConvert(inputLines, output) + + + def test_TPMultipleOptions(self): + """ + Try to parse multiple C{TP} fields. + """ + inputLines =3D ['.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 =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          HEADER

          \n\n
          " + "-o, --option\n
          " + "
          An option\n
          \n\n
          " + "-n, --another\n
          " + "
          Another option\n
          \n\n
          \n\n\n\n") + self.assertConvert(inputLines, output) + + + def test_TPMultiLineOptions(self): + """ + Try to parse multiple C{TP} fields, with options text on several lin= es. + """ + inputLines =3D ['.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 =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          HEADER

          \n\n
          " + "-o, --option\n
          " + "
          An option\non two lines\n
          \n\n" + "
          -n, --another\n" + "
          Another option\non two lines\n
          \n\n
          \n\n" + "\n\n") + self.assertConvert(inputLines, output) + + + def test_ITLegacyManagement(self): + """ + Test management of BL/IT/EL used in some man pages. + """ + inputLines =3D ['.TH BAR "1" "Oct 2007" "" ""', + ".SH HEADER", + ".BL", + ".IT An option", + "on two lines", + ".IT", + "Another option", + "on two lines", + ".EL" + ] + output =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          HEADER

          \n\n
          " + "
          on two lines\n
          Another option\non two lines\n" + "
          \n\n\n\n") + self.assertConvert(inputLines, output) + + + def test_interactiveCommand(self): + """ + Test management of interactive command tag. + """ + inputLines =3D ['.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 =3D ("\nBAR.1\n\n\n" + "

          BAR.1

          \n\n

          HEADER

          \n\n
          " + "
          foo bar
          option 1\n
          egg " + "spam [stuff]
          option 2\n
          " + "\n\n\n\n") + self.assertConvert(inputLines, output) diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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 @@ =20 @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. =20 @return: C{None} """ - if not indexFilename: - return - indexLinks =3D domhelpers.findElementsWithAttribute(template, "class", "= index-link") + indexLinks =3D domhelpers.findElementsWithAttribute(template, + "class", + "index-link") for link in indexLinks: - link.nodeName =3D link.tagName =3D link.endTagName =3D 'a' - link.attributes =3D InsensitiveDict({'href': indexFilename}) + if indexFilename is None: + link.parentNode.removeChild(link) + else: + link.nodeName =3D link.tagName =3D link.endTagName =3D 'a' + link.attributes =3D InsensitiveDict({'href': indexFilename}) =20 =20 =20 diff -urN --exclude=3DCVS --exclude=3D.cvsignore --exclude=3D.svn --exclude= =3D.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.000000= 000 +0100 +++ new/TwistedLore-8.0.0/twisted/lore/_version.py 2008-03-25 17:13:14.000000= 000 +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 =3D versions.Version(__name__[:__name__.rfind('.')], 0, 3, 0) +version =3D versions.Version('twisted.lore', 8, 0, 0) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: opensuse-commit+help(a)opensuse.org --===============8308710990830102172==--