Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(106) |
May
(215) |
Jun
(104) |
Jul
(290) |
Aug
(351) |
Sep
(245) |
Oct
(289) |
Nov
(184) |
Dec
(113) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(179) |
Feb
(88) |
Mar
(77) |
Apr
(70) |
May
(107) |
Jun
(288) |
Jul
(115) |
Aug
(67) |
Sep
(91) |
Oct
(34) |
Nov
(31) |
Dec
(61) |
2004 |
Jan
(54) |
Feb
(17) |
Mar
(102) |
Apr
(152) |
May
(178) |
Jun
(377) |
Jul
(136) |
Aug
(37) |
Sep
(196) |
Oct
(142) |
Nov
(119) |
Dec
(58) |
2005 |
Jan
(51) |
Feb
(76) |
Mar
(220) |
Apr
(132) |
May
(134) |
Jun
(230) |
Jul
(142) |
Aug
(58) |
Sep
(71) |
Oct
(76) |
Nov
(129) |
Dec
(117) |
2006 |
Jan
(94) |
Feb
(30) |
Mar
(97) |
Apr
(63) |
May
(63) |
Jun
(62) |
Jul
(23) |
Aug
(40) |
Sep
(47) |
Oct
(40) |
Nov
(23) |
Dec
(21) |
2007 |
Jan
(57) |
Feb
(65) |
Mar
(77) |
Apr
(23) |
May
(118) |
Jun
(127) |
Jul
(87) |
Aug
(33) |
Sep
(26) |
Oct
(8) |
Nov
(4) |
Dec
(25) |
2008 |
Jan
(16) |
Feb
(18) |
Mar
(16) |
Apr
(4) |
May
(22) |
Jun
(20) |
Jul
(38) |
Aug
(14) |
Sep
(18) |
Oct
(68) |
Nov
(16) |
Dec
(95) |
2009 |
Jan
(28) |
Feb
(16) |
Mar
(8) |
Apr
(44) |
May
(35) |
Jun
(41) |
Jul
(63) |
Aug
(40) |
Sep
(38) |
Oct
(41) |
Nov
(17) |
Dec
(9) |
2010 |
Jan
(9) |
Feb
(3) |
Mar
(71) |
Apr
(20) |
May
(15) |
Jun
(16) |
Jul
(33) |
Aug
(13) |
Sep
(39) |
Oct
(30) |
Nov
(25) |
Dec
(20) |
2011 |
Jan
(213) |
Feb
(252) |
Mar
(24) |
Apr
(24) |
May
(20) |
Jun
(21) |
Jul
(37) |
Aug
(18) |
Sep
(28) |
Oct
(65) |
Nov
(22) |
Dec
(48) |
2012 |
Jan
(35) |
Feb
(39) |
Mar
(17) |
Apr
(9) |
May
(37) |
Jun
(31) |
Jul
(23) |
Aug
(14) |
Sep
(16) |
Oct
(15) |
Nov
(5) |
Dec
(43) |
2013 |
Jan
(15) |
Feb
(19) |
Mar
(26) |
Apr
(13) |
May
(9) |
Jun
(11) |
Jul
(32) |
Aug
(9) |
Sep
(6) |
Oct
|
Nov
(13) |
Dec
(5) |
2014 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(18) |
Aug
|
Sep
|
Oct
(3) |
Nov
(4) |
Dec
(2) |
2015 |
Jan
(3) |
Feb
(25) |
Mar
(49) |
Apr
(28) |
May
(13) |
Jun
(2) |
Jul
(2) |
Aug
(14) |
Sep
(9) |
Oct
(6) |
Nov
|
Dec
(2) |
2016 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
(12) |
Jun
|
Jul
(17) |
Aug
(7) |
Sep
(3) |
Oct
(2) |
Nov
(5) |
Dec
(28) |
2017 |
Jan
(11) |
Feb
(6) |
Mar
(10) |
Apr
(10) |
May
(34) |
Jun
(32) |
Jul
(15) |
Aug
(28) |
Sep
(8) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2018 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(2) |
2
|
3
(1) |
4
|
5
|
6
|
7
|
8
(1) |
9
(5) |
10
|
11
(5) |
12
(1) |
13
(9) |
14
(8) |
15
(2) |
16
(4) |
17
(1) |
18
|
19
(2) |
20
|
21
|
22
(2) |
23
|
24
|
25
(8) |
26
(1) |
27
(4) |
28
(1) |
29
(1) |
30
(2) |
31
(3) |
|
|
|
From: <grubert@us...> - 2006-05-14 15:40:16
|
Author: grubert Date: 2006-05-14 17:41:45 +0200 (Sun, 14 May 2006) New Revision: 4553 Modified: trunk/sandbox/pydoc-writer/mkpydoc.py Log: Fix: sectionauthor assignment Add: release and shortversion Modified: trunk/sandbox/pydoc-writer/mkpydoc.py =================================================================== --- trunk/sandbox/pydoc-writer/mkpydoc.py 2006-05-14 14:04:51 UTC (rev 4552) +++ trunk/sandbox/pydoc-writer/mkpydoc.py 2006-05-14 15:41:45 UTC (rev 4553) @@ -117,6 +117,15 @@ self.body.append( "\\modulesynopsis{%(synopsis)s}\n" % self.docinfo ) + if self.docinfo.has_key("release"): + self.body.append( "\\release{%(release)s}\n" % self.docinfo ) + if self.docinfo.has_key("shortversion"): + self.body.append( "\\setshortversion{%(shortversion)s}\n" + % self.docinfo ) + if self.docinfo.has_key("sectionauthor"): + self.body.append( + "\\sectionauthor{%(sectionauthor)s}{%(sectionauthoremail)s}\n" + % self.docinfo ) if self.docinfo.has_key("versionadded"): self.body.append( "\\versionadded{%(versionadded)s}\n" @@ -140,7 +149,7 @@ self.docinfo["moduleauthor"] = ename self.docinfo["moduleauthoremail"] = email elif name in ("author", "sectionauthor") : - (ename, email) = rfc822.parseaddr(node.astext()) + (ename, email) = rfc822.parseaddr(node[1].astext()) self.docinfo["sectionauthor"] = ename self.docinfo["sectionauthoremail"] = email else: |
From: <fwiemann@us...> - 2006-05-14 14:03:16
|
Author: fwiemann Date: 2006-05-14 16:04:51 +0200 (Sun, 14 May 2006) New Revision: 4552 Modified: trunk/docutils/BUGS.txt Log: added bug about error reporting Modified: trunk/docutils/BUGS.txt =================================================================== --- trunk/docutils/BUGS.txt 2006-05-14 13:49:07 UTC (rev 4551) +++ trunk/docutils/BUGS.txt 2006-05-14 14:04:51 UTC (rev 4552) @@ -111,6 +111,12 @@ Also see the `SourceForge Bug Tracker`_. +* .. _error reporting: + + Calling rst2s5.py with a non-existent theme (``--theme + does_not_exist``) or a non-existent language (``--language zz``) + causes exceptions. Such errors should be handled more gracefully. + * There's a problem with _`hyperlink references in substitutions`:: |rst| is cool! |
From: <fwiemann@us...> - 2006-05-14 13:47:32
|
Author: fwiemann Date: 2006-05-14 15:49:07 +0200 (Sun, 14 May 2006) New Revision: 4551 Modified: trunk/docutils/BUGS.txt Log: added bug about hyperlink references in substitutions; thanks to Gr?\195?\169goire Weber for reporting this! Modified: trunk/docutils/BUGS.txt =================================================================== --- trunk/docutils/BUGS.txt 2006-05-14 13:46:39 UTC (rev 4550) +++ trunk/docutils/BUGS.txt 2006-05-14 13:49:07 UTC (rev 4551) @@ -111,6 +111,14 @@ Also see the `SourceForge Bug Tracker`_. +* There's a problem with _`hyperlink references in substitutions`:: + + |rst| is cool! + + .. |rst| replace:: reStructuredText_ + + .. _reStructuredText: http://docutils.sourceforge.net/rst.html + * The "stylesheet" setting (a URL, to be used verbatim) should be allowed to be combined with "embed_stylesheet". The stylesheet data should be read in using urllib. There was an assumption that a |
From: <fwiemann@us...> - 2006-05-14 13:45:09
|
Author: fwiemann Date: 2006-05-14 15:46:39 +0200 (Sun, 14 May 2006) New Revision: 4550 Modified: trunk/docutils/docs/dev/todo.txt Log: added link to message "Reference name limitations" by Yannick Copin Modified: trunk/docutils/docs/dev/todo.txt =================================================================== --- trunk/docutils/docs/dev/todo.txt 2006-05-14 09:55:56 UTC (rev 4549) +++ trunk/docutils/docs/dev/todo.txt 2006-05-14 13:46:39 UTC (rev 4550) @@ -760,9 +760,10 @@ item in a single line as ordinary paragraphs. See <http://article.gmane.org/gmane.text.docutils.user/2635>. -* The citation syntax could use some enhancements. See - <http://thread.gmane.org/gmane.text.docutils.user/2499> and - <http://thread.gmane.org/gmane.text.docutils.user/2443>. +* The citation syntax could use some improvements. See + <http://thread.gmane.org/gmane.text.docutils.user/2499>, + <http://thread.gmane.org/gmane.text.docutils.user/2443>, + <http://thread.gmane.org/gmane.text.docutils.user/2715>. * The current list-recognition logic has too many false positives, as in :: |
From: <grubert@us...> - 2006-05-14 09:54:43
|
Author: grubert Date: 2006-05-14 11:55:56 +0200 (Sun, 14 May 2006) New Revision: 4549 Modified: trunk/sandbox/pydoc-writer/README.txt trunk/sandbox/pydoc-writer/expected/libctypes.tex trunk/sandbox/pydoc-writer/input/libctypes.txt trunk/sandbox/pydoc-writer/mkpydoc.py Log: Restructure docinfo processing: dont output empty statements. Remove popen2 and glob imports. Modified: trunk/sandbox/pydoc-writer/README.txt =================================================================== --- trunk/sandbox/pydoc-writer/README.txt 2006-05-14 02:05:30 UTC (rev 4548) +++ trunk/sandbox/pydoc-writer/README.txt 2006-05-14 09:55:56 UTC (rev 4549) @@ -25,6 +25,24 @@ <http://www.rexx.com/~dkuhlman/rstpythonlatex_intro.html>`__. +Module information +'''''''''''''''''' + +Maybe make title "ctypes --- A foreign function library for Python" +or use pep reader ? + +For example :: + + :Module: ctypes + :Summary: A foreign function library for Python. + :Module Type: standard + :Author: Thomas Heller <theller@...> + :Synopsis: A foreign function library for Python. + :Version Added: 2.5 + + +Module and Summary are mandatory. + Problems '''''''' Modified: trunk/sandbox/pydoc-writer/expected/libctypes.tex =================================================================== --- trunk/sandbox/pydoc-writer/expected/libctypes.tex 2006-05-14 02:05:30 UTC (rev 4548) +++ trunk/sandbox/pydoc-writer/expected/libctypes.tex 2006-05-14 09:55:56 UTC (rev 4549) @@ -5,10 +5,8 @@ \moduleauthor{Thomas Heller}{theller@...} \modulesynopsis{A foreign function library for Python.} \versionadded{2.5} - - -\section{ctypes\label{ctypes-ctypes}} % maybe make title "ctypes --- A foreign function library for Python" +% or use pep reader and \subsection{ctypes tutorial\label{ctypes-ctypes-tutorial}} Modified: trunk/sandbox/pydoc-writer/input/libctypes.txt =================================================================== --- trunk/sandbox/pydoc-writer/input/libctypes.txt 2006-05-14 02:05:30 UTC (rev 4548) +++ trunk/sandbox/pydoc-writer/input/libctypes.txt 2006-05-14 09:55:56 UTC (rev 4549) @@ -2,12 +2,11 @@ .. or use pep reader and -:Module Name: ctypes -:Module Summary: A foreign function library for Python. +:Module: ctypes +:Summary: A foreign function library for Python. :Module Type: standard -:Module Author: Thomas Heller -:Module Author Email: theller@... -:Module Synopsis: A foreign function library for Python. +:Author: Thomas Heller <theller@...> +:Synopsis: A foreign function library for Python. :Version Added: 2.5 .. include:: tutorial.txt Modified: trunk/sandbox/pydoc-writer/mkpydoc.py =================================================================== --- trunk/sandbox/pydoc-writer/mkpydoc.py 2006-05-14 02:05:30 UTC (rev 4548) +++ trunk/sandbox/pydoc-writer/mkpydoc.py 2006-05-14 09:55:56 UTC (rev 4549) @@ -1,13 +1,11 @@ #!/usr/bin/python -# Convert the ctypes docs to LaTeX for use in Python docs +# Convert the reStructuredText docs to LaTeX for use in Python docs # This script is a hacked version taken from the Optik SVN repository. import sys, os import re -from popen2 import popen2 -from glob import glob import rfc822 from distutils.dep_util import newer_group, newer from docutils.core import Publisher @@ -44,14 +42,6 @@ remap_title = { } roman = (None,None,"ii","iii","iv","v") - # XXX need to factor this out - module_name = "ctypes" - module_summary = "A foreign function library for Python." - module_type = "standard" - module_author = "Thomas Heller" - module_author_email = "theller@..." - module_synopsis = ("A foreign function library for Python.") - version_added = "2.5" refuri_override = { "reference" : "reference-guide", @@ -60,6 +50,8 @@ def __init__(self, document): LaTeXTranslator.__init__(self, document) + self.label_prefix = "" + self.docinfo = {} self.head_prefix = [] self.head = [] self.body_prefix = [] @@ -74,16 +66,7 @@ 'field_name'): setattr(self, 'visit_' + nodetype, empty_method) setattr(self, 'depart_' + nodetype, empty_method) - # TODO document properties from document self.head_prefix = [] - dummy = [ - "\\section{\\module{%(module_name)s} --- %(module_summary)s}\n" - "\\declaremodule{%(module_type)s}{%(module_name)s}\n" - "\\moduleauthor{%(module_author)s}{%(module_author_email)s}\n" - "\\modulesynopsis{%(module_synopsis)s}\n" - "\\versionadded{%(version_added)s}\n" - % vars(self.__class__) - ] # definitions must be guarded if multiple modules are included self.definitions = [ "\\ifx\\locallinewidth\\undefined\\newlength{\\locallinewidth}\\fi\n" @@ -97,14 +80,16 @@ self.body + self.body_suffix) + def set_label_prefix(self, text): + self.label_prefix = text.replace(" ","-") + def generate_section_label(self, title): title = title.lower() title = re.sub(r'\([^\)]*\)', '', title) title = re.sub(r'[^\w\s\-]', '', title) title = re.sub(r'\b(the|an?|and|your|are)\b', '', title) title = re.sub(r'(example \d+).*', r'\1', title) -## title = title.replace("optik", "optparse") - return "ctypes-" + "-".join(title.split()) + return self.label_prefix + "-" + "-".join(title.split()) def visit_document(self, node): pass @@ -113,39 +98,55 @@ pass def visit_docinfo(self, node): - self.docinfo = {"module":"", - "summary":"", - "module type":"", - "module author":"", - "module author email":"", - "module synopsis":"", - "version added":""} + pass def depart_docinfo(self, node): - #self.body = self.docinfo + self.body - self.body.append(''.join( - "\\section{\\module{%(module name)s} --- %(module summary)s}\n" - "\\declaremodule{%(module type)s}{%(module name)s}\n" - "\\moduleauthor{%(module author)s}{%(module author email)s}\n" - "\\modulesynopsis{%(module synopsis)s}\n" - "\\versionadded{%(version added)s}\n" - % self.docinfo)) - self.docinfo = None + # module and summary are mandatory + self.body.append( + "\\section{\\module{%(module)s} --- %(summary)s}\n" + % self.docinfo ) + if self.docinfo.has_key("moduletype"): + self.body.append( + "\\declaremodule{%(moduletype)s}{%(module)s}\n" + % self.docinfo ) + if self.docinfo.has_key("moduleauthor"): + self.body.append( + "\\moduleauthor{%(moduleauthor)s}{%(moduleauthoremail)s}\n" + % self.docinfo ) + if self.docinfo.has_key("synopsis"): + self.body.append( + "\\modulesynopsis{%(synopsis)s}\n" + % self.docinfo ) + if self.docinfo.has_key("versionadded"): + self.body.append( + "\\versionadded{%(versionadded)s}\n" + % self.docinfo ) def visit_docinfo_item(self, node, name): - print "visit_docinfo_item: node=%r, name=%r" % (node, name) if name == "author": - (name, email) = rfc822.parseaddr(node.astext()) - self.docinfo.append("\\sectionauthor{%s}{%s}\n" % (name, email)) + (ename, email) = rfc822.parseaddr(node.astext()) + self.docinfo["moduleauthor"] = ename + self.docinfo["moduleauthoremail"] = email raise nodes.SkipNode def depart_docinfo_item(self, node): pass def visit_field(self, node): - (name, value) = (node[0].astext(), node[1].astext()) - if self.docinfo is not None: - self.docinfo[node[0].astext().lower()] = node[1].astext() + if isinstance(node.parent, nodes.docinfo): + name = node[0].astext().lower().replace(" ","") + if name == "moduleauthor": + (ename, email) = rfc822.parseaddr(node[1].astext()) + self.docinfo["moduleauthor"] = ename + self.docinfo["moduleauthoremail"] = email + elif name in ("author", "sectionauthor") : + (ename, email) = rfc822.parseaddr(node.astext()) + self.docinfo["sectionauthor"] = ename + self.docinfo["sectionauthoremail"] = email + else: + if name == "module": + self.set_label_prefix(node[1].astext()) + self.docinfo[name] = node[1].astext() raise nodes.SkipNode _quoted_string_re = re.compile(r'\"[^\"]*\"') @@ -158,7 +159,6 @@ def visit_literal(self, node): assert isinstance(node[0], nodes.Text) text = node[0].data -#### text = re.sub(r'optik(\.[a-z]+)?\.', 'optparse.', text) if self.in_title: cmd = None elif self._quoted_string_re.match(text): @@ -231,8 +231,8 @@ self.body.append(self.anydesc_title(title)) raise nodes.SkipNode title = self.remap_title.get(title, title) + # TODO label_prefix might not be set yet. label = self.generate_section_label(title) - #print "%s -> %s" % (title, label) section_name = self.d_class.section(self.section_level + 1) self.body.append("\n\n\\%s{" % section_name) self.context.append("\\label{%s}}\n" % label) @@ -267,7 +267,7 @@ if node.has_key('refuri'): refuri = node['refuri'] basename = os.path.splitext(refuri)[0] - label = "optparse-" + self.refuri_override.get(basename, basename) + label = self.label_prefix + "-" + self.refuri_override.get(basename, basename) print "got refuri=%r, label=%r" % (refuri, label) elif node.has_key('refid'): label = self.generate_section_label(node['refid']) @@ -291,12 +291,10 @@ text = self._em_dash_re.sub(u"\u2014", text) text = self._quoted_phrase_re.sub(u"\u201C\\1\u201D", text) text = re.sub(r'\bdocument\b', "section", text) -#### text = re.sub(r'optik(\.[a-z]+)?', 'optparse', text) text = self.encode(text) # A couple of transformations are easiest if they go direct # to LaTeX, so do them *after* encode(). -## text = text.replace("Optik", "\\module{optparse}") text = text.replace("UNIX", "\\UNIX{}") self.body.append(text) |
From: <fwiemann@us...> - 2006-05-14 02:04:28
|
Author: fwiemann Date: 2006-05-14 04:05:30 +0200 (Sun, 14 May 2006) New Revision: 4548 Modified: / Log: removed the (accidentally committed) svk:merge property Property changes on: ___________________________________________________________________ Name: svk:merge - 3f2d1486-1405-0410-8128-d3e4cb65ce36:/local/docutils:4738 |
Author: fwiemann Date: 2006-05-14 02:26:50 +0200 (Sun, 14 May 2006) New Revision: 4547 Modified: / branches/directives/docutils/docutils/parsers/rst/__init__.py branches/directives/docutils/docutils/parsers/rst/directives/admonitions.py branches/directives/docutils/docutils/parsers/rst/directives/body.py branches/directives/docutils/docutils/parsers/rst/directives/html.py branches/directives/docutils/docutils/parsers/rst/directives/misc.py branches/directives/docutils/docutils/parsers/rst/states.py branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_line_blocks.py branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_topics.py Log: added docutils.parsers.rst.SystemMessage, to be thrown from directive code; use it in some places; catch it in the reST parser; added Directive.assert_has_content, and use it added some assertions for directives' return values; Property changes on: ___________________________________________________________________ Name: svk:merge + 3f2d1486-1405-0410-8128-d3e4cb65ce36:/local/docutils:4738 Modified: branches/directives/docutils/docutils/parsers/rst/__init__.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/__init__.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/__init__.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -156,6 +156,22 @@ self.finish_parse() +class SystemMessage(Exception): + + """ + "Dumb" system message that only stores the message itself and the level. + + To be thrown from inside directive code. + + Do not instantiate directly -- use `Directive.system_message()` instead! + """ + + def __init__(self, level, message): + Exception.__init__(self) + self.level = level + self.message = message + + class Directive: """ @@ -258,40 +274,45 @@ def run(self): raise NotImplementedError('Must override run() is subclass.') - # Convenience methods: + # System messages: - def system_message(self, level, message, *children, **kwargs): + def system_message(self, level, message): """ - Return a system message with the current directive block and - the line number set. + Return a SystemMessage suitable for being thrown as an exception. - Call "return [self.system_message(level, message)]" from + Call "raise self.system_message(level, message)" from within a directive implementation to return one single system message, which automatically gets the directive block and the line number added. """ - children += (nodes.literal_block(self.block_text, self.block_text),) - kwargs.setdefault('line', self.lineno) - return self.state_machine.reporter.system_message( - level, message, *children, **kwargs) + return SystemMessage(level, message) - def debug(self, *args, **kwargs): - return self.system_message(0, *args, **kwargs) + def debug(self, message): + return self.system_message(0, message) - def info(self, *args, **kwargs): - return self.system_message(1, *args, **kwargs) + def info(self, message): + return self.system_message(1, message) - def warning(self, *args, **kwargs): - return self.system_message(2, *args, **kwargs) + def warning(self, message): + return self.system_message(2, message) - def error(self, *args, **kwargs): - return self.system_message(3, *args, **kwargs) + def error(self, message): + return self.system_message(3, message) - def severe(self, *args, **kwargs): - return self.system_message(4, *args, **kwargs) + def severe(self, message): + return self.system_message(4, message) + # Convenience methods: + def assert_has_content(self): + """ + Throw an "error" SystemMessage if the directive doesn't have contents. + """ + if not self.content: + raise self.error('Content block expected for the "%s" directive; ' + 'none found.' % self.name) + def convert_directive_function(directive_fn): """ Define & return a directive class generated from `directive_fn`. Modified: branches/directives/docutils/docutils/parsers/rst/directives/admonitions.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/directives/admonitions.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/directives/admonitions.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -28,12 +28,7 @@ """Subclasses must set this to the appropriate admonition node class.""" def run(self): - if not self.content: - error = self.state_machine.reporter.error( - 'The "%s" admonition is empty; content required.' % self.name, - nodes.literal_block(self.block_text, self.block_text), - line=self.lineno) - return [error] + self.assert_has_content() text = '\n'.join(self.content) admonition_node = self.node_class(text) if self.arguments: Modified: branches/directives/docutils/docutils/parsers/rst/directives/body.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/directives/body.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/directives/body.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -34,17 +34,9 @@ def run(self): if not (self.state_machine.match_titles or isinstance(self.state_machine.node, nodes.sidebar)): - error = self.state_machine.reporter.error( - 'The "%s" directive may not be used within topics or body ' - 'elements.' % self.name, nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [error] - if not self.content: - warning = self.state_machine.reporter.warning( - 'Content block expected for the "%s" directive; none found.' - % self.name, nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [warning] + raise self.error('The "%s" directive may not be used within ' + 'topics or body elements.' % self.name) + self.assert_has_content() title_text = self.arguments[0] textnodes, messages = self.state.inline_text(title_text, self.lineno) titles = [nodes.title(title_text, '', *textnodes)] @@ -77,11 +69,8 @@ def run(self): if isinstance(self.state_machine.node, nodes.sidebar): - error = self.state_machine.reporter.error( - 'The "%s" directive may not be used within a sidebar element.' - % self.name, nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [error] + raise self.error('The "%s" directive may not be used within a ' + 'sidebar element.' % self.name) return BasePseudoSection.run(self) @@ -91,12 +80,7 @@ has_content = True def run(self): - if not self.content: - warning = self.state_machine.reporter.warning( - 'Content block expected for the "%s" directive; none found.' - % self.name, nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [warning] + self.assert_has_content() block = nodes.line_block(classes=self.options.get('class', [])) node_list = [block] for line_text in self.content: @@ -119,12 +103,7 @@ def run(self): set_classes(self.options) - if not self.content: - warning = self.state_machine.reporter.warning( - 'Content block expected for the "%s" directive; none found.' - % self.name, nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [warning] + self.assert_has_content() text = '\n'.join(self.content) text_nodes, messages = self.state.inline_text(text, self.lineno) node = nodes.literal_block(text, '', *text_nodes, **self.options) @@ -180,12 +159,8 @@ has_content = True def run(self): + self.assert_has_content() text = '\n'.join(self.content) - if not text: - error = self.state_machine.reporter.error( - 'The "%s" directive is empty; content required.' % name, - nodes.literal_block(block_text, block_text), line=lineno) - return [error] node = nodes.compound(text) node['classes'] += self.options.get('class', []) self.state.nested_parse(self.content, self.content_offset, node) @@ -200,24 +175,17 @@ has_content = True def run(self): + self.assert_has_content() text = '\n'.join(self.content) - if not text: - error = self.state_machine.reporter.error( - 'The "%s" directive is empty; content required.' % self.name, - nodes.literal_block(self.block_text, self.block_text), - line=self.lineno) - return [error] try: if self.arguments: classes = directives.class_option(self.arguments[0]) else: classes = [] except ValueError: - error = self.state_machine.reporter.error( + raise self.error( 'Invalid class attribute value for "%s" directive: "%s".' - % (self.name, self.arguments[0]), nodes.literal_block( - self.block_text, self.block_text), line=self.lineno) - return [error] + % (self.name, self.arguments[0])) node = nodes.container(text) node['classes'].extend(classes) self.state.nested_parse(self.content, self.content_offset, node) Modified: branches/directives/docutils/docutils/parsers/rst/directives/html.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/directives/html.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/directives/html.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -89,7 +89,7 @@ node += error else: error = self.state_machine.reporter.error( - 'Empty meta directive.', + 'Empty %s directive.' % self.name, nodes.literal_block(self.block_text, self.block_text), line=self.lineno) node += error Modified: branches/directives/docutils/docutils/parsers/rst/directives/misc.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/directives/misc.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/directives/misc.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -32,11 +32,7 @@ def run(self): """Include a reST file as part of the content of this reST file.""" if not self.state.document.settings.file_insertion_enabled: - warning = self.state_machine.reporter.warning( - '"%s" directive disabled.' % self.name, - nodes.literal_block(self.block_text, self.block_text), - line=self.lineno) - return [warning] + raise self.warning('"%s" directive disabled.' % self.name) source = self.state_machine.input_lines.source( self.lineno - self.state_machine.input_offset - 1) source_dir = os.path.dirname(os.path.abspath(source)) @@ -55,26 +51,19 @@ input_encoding_error_handler), handle_io_errors=None) except IOError, error: - severe = self.state_machine.reporter.severe( - 'Problems with "%s" directive path:\n%s: %s.' - % (self.name, error.__class__.__name__, error), - nodes.literal_block(self.block_text, self.block_text), - line=self.lineno) - return [severe] + raise self.severe('Problems with "%s" directive path:\n%s: %s.' + % (self.name, error.__class__.__name__, error)) try: include_text = include_file.read() except UnicodeError, error: - severe = self.state_machine.reporter.severe( - 'Problem with "%s" directive:\n%s: %s' - % (self.name, error.__class__.__name__, error), - nodes.literal_block(self.block_text, self.block_text), - line=self.lineno) - return [severe] + raise self.severe( + 'Problem with "%s" directive:\n%s: %s' + % (self.name, error.__class__.__name__, error)) if self.options.has_key('literal'): literal_block = nodes.literal_block(include_text, include_text, source=path) literal_block.line = 1 - return literal_block + return [literal_block] else: include_lines = statemachine.string2lines(include_text, convert_whitespace=1) @@ -255,9 +244,9 @@ def run(self): if not isinstance(self.state, states.SubstitutionDef): - return [self.error('Invalid context: the "%s" directive can only ' - 'be used within a substitution definition.' - % self.name)] + raise self.error('Invalid context: the "%s" directive can only ' + 'be used within a substitution definition.' + % self.name) substitution_definition = self.state_machine.node if self.options.has_key('trim'): substitution_definition.attributes['ltrim'] = 1 @@ -272,9 +261,9 @@ try: decoded = directives.unicode_code(code) except ValueError, err: - return [self.error( + raise self.error( 'Invalid character code: %s\n%s: %s' - % (code, err.__class__.__name__, err))] + % (code, err.__class__.__name__, err)) element += nodes.Text(decoded) return element.children Modified: branches/directives/docutils/docutils/parsers/rst/states.py =================================================================== --- branches/directives/docutils/docutils/parsers/rst/states.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/docutils/parsers/rst/states.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -115,6 +115,7 @@ from docutils.nodes import fully_normalize_name as normalize_name from docutils.nodes import whitespace_normalize_name from docutils.utils import escape2null, unescape, column_width +import docutils.parsers.rst from docutils.parsers.rst import directives, languages, tableparser, roles from docutils.parsers.rst.languages import en as _fallback_language_module @@ -2019,7 +2020,19 @@ directive_instance = directive( type_name, arguments, options, content, lineno, content_offset, block_text, self, self.state_machine) - result = directive_instance.run() + try: + result = directive_instance.run() + except docutils.parsers.rst.SystemMessage, msg: + msg_node = self.reporter.system_message(msg.level, msg.message) + msg_node += nodes.literal_block(block_text, block_text) + msg_node['line'] = lineno + result = [msg_node] + assert isinstance(result, list), \ + 'Directive "%s" must return a list of nodes.' % type_name + for i in range(len(result)): + assert isinstance(result[i], nodes.Node), \ + ('Directive "%s" returned non-Node object (index %s): %r' + % (type_name, i, result[i])) return (result, blank_finish or self.state_machine.is_next_line_blank()) Modified: branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py =================================================================== --- branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -116,7 +116,7 @@ <document source="test data"> <system_message level="3" line="1" source="test data" type="ERROR"> <paragraph> - The "note" admonition is empty; content required. + Content block expected for the "note" directive; none found. <literal_block xml:space="preserve"> .. note:: """], Modified: branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_line_blocks.py =================================================================== --- branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_line_blocks.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_line_blocks.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -67,7 +67,7 @@ """, """\ <document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> + <system_message level="3" line="1" source="test data" type="ERROR"> <paragraph> Content block expected for the "line-block" directive; none found. <literal_block xml:space="preserve"> Modified: branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py =================================================================== --- branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -53,7 +53,7 @@ """, """\ <document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> + <system_message level="3" line="1" source="test data" type="ERROR"> <paragraph> Content block expected for the "parsed-literal" directive; none found. <literal_block xml:space="preserve"> Modified: branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_topics.py =================================================================== --- branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_topics.py 2006-05-14 00:05:28 UTC (rev 4546) +++ branches/directives/docutils/test/test_parsers/test_rst/test_directives/test_topics.py 2006-05-14 00:26:50 UTC (rev 4547) @@ -37,7 +37,7 @@ """, """\ <document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> + <system_message level="3" line="1" source="test data" type="ERROR"> <paragraph> Content block expected for the "topic" directive; none found. <literal_block xml:space="preserve"> @@ -82,7 +82,7 @@ """, """\ <document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> + <system_message level="3" line="1" source="test data" type="ERROR"> <paragraph> Content block expected for the "topic" directive; none found. <literal_block xml:space="preserve"> |
From: <blais@us...> - 2006-05-14 00:04:19
|
Author: blais Date: 2006-05-14 02:05:28 +0200 (Sun, 14 May 2006) New Revision: 4546 Modified: trunk/docutils/docs/user/emacs.txt Log: Changed docs a bit about rst-mode and obsolete note about document conversion. Modified: trunk/docutils/docs/user/emacs.txt =================================================================== --- trunk/docutils/docs/user/emacs.txt 2006-05-13 23:50:18 UTC (rev 4545) +++ trunk/docutils/docs/user/emacs.txt 2006-05-14 00:05:28 UTC (rev 4546) @@ -349,7 +349,11 @@ Major Mode for Editing reStructuredText Documents ================================================= -There is a major mode available for editing and syntax highlighting +The great majority of the functionality for supporting +reStructuredText_ can be invoked directly from Emacs' vanilla +text-mode. + +However, there is also a major mode that adds syntax highlighting to reStructuredText_ constructs. This mode was written by Stefan Merten [#]_. It mostly provides lazy syntax coloring for many of the constructs that reStructuredText_ prescribes. @@ -385,12 +389,9 @@ Converting Documents from Emacs =============================== -At the moment there is minimal support for calling the conversion -tools from within Emacs. You can add a key binding like this to -invoke it:: +We provide a function (``rst-compile``) for invoking the document +converters from within emacs. It is bound on ``C-c p c``. - (local-set-key [(control c)(?9)] 'rst-compile) - This function basically creates a compilation command with the correct output name for the current buffer and then invokes Emacs' compile function. It also looks for the presence of a ``docutils.conf`` |