diff options
| -rw-r--r-- | docutils/HISTORY.txt | 2 | ||||
| -rw-r--r-- | docutils/docs/dev/pysource.dtd | 12 | ||||
| -rw-r--r-- | docutils/docs/dev/todo.txt | 4 | ||||
| -rw-r--r-- | docutils/docutils/core.py | 9 | ||||
| -rw-r--r-- | docutils/docutils/parsers/rst/directives/misc.py | 3 | ||||
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 2 | ||||
| -rwxr-xr-x | docutils/tools/buildhtml.py | 2 | ||||
| -rw-r--r-- | sandbox/richard/ZReST/ZReST.py | 10 | ||||
| -rwxr-xr-x | sandbox/tibs/pysource/visit.py | 6 |
9 files changed, 35 insertions, 15 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 44c16229a..9ed4b4ae6 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -122,6 +122,7 @@ Specific: - Added defaults for source & destination paths. - Allow for Unicode I/O with an explicit "unicode" encoding. - Added ``Output.encode()``. + - Deprecated reliance on runtime settings; pass encoding directly. * docutils/nodes.py: @@ -337,6 +338,7 @@ Specific: * docutils/writers/docutils-xml.py: - Added XML and doctype declarations. + - Added "--no-doctype" and "--no-xml-declaration" options. * docutils/writers/html4css1.py: diff --git a/docutils/docs/dev/pysource.dtd b/docutils/docs/dev/pysource.dtd index 02d754358..79a074cec 100644 --- a/docutils/docs/dev/pysource.dtd +++ b/docutils/docs/dev/pysource.dtd @@ -29,7 +29,8 @@ The formal public identifier for this DTD is:: <!ENTITY % additional.section.elements " | package_section | module_section | class_section - | method_section | function_section | module_attribute_section + | method_section | function_section + | module_attribute_section | function_attribute_section | class_attribute_section | instance_attribute_section "> <!ENTITY % additional.inline.elements @@ -84,6 +85,10 @@ http://docutils.sourceforge.net/spec/docutils.dtd. (attribute, initial_value?, fullname?, %structure.model;)> <!ATTLIST module_attribute_section %basic.atts;> +<!ELEMENT function_attribute_section + (attribute, initial_value?, fullname?, %structure.model;)> +<!ATTLIST function_attribute_section %basic.atts;> + <!ELEMENT class_attribute_section (attribute, initial_value?, fullname?, overrides?, %structure.model;)> @@ -94,6 +99,11 @@ http://docutils.sourceforge.net/spec/docutils.dtd. %structure.model;)> <!ATTLIST instance_attribute_section %basic.atts;> +<!-- + Section Subelements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + <!ELEMENT fullname (package | module | class | method | function | attribute)+> <!ATTLIST fullname %basic.atts;> diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt index 3a194edad..51978fcb9 100644 --- a/docutils/docs/dev/todo.txt +++ b/docutils/docs/dev/todo.txt @@ -298,7 +298,9 @@ General Engelbert Gruber.) * Should I/O objects be passed simple encoding name strings instead of - a full-blown settings object? + a full-blown settings object? Yes. + + @@@ Remove "settings" parameters before next release. Documentation diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py index fa99df483..f73ccf338 100644 --- a/docutils/docutils/core.py +++ b/docutils/docutils/core.py @@ -137,8 +137,9 @@ class Publisher: source_path = self.settings._source else: self.settings._source = source_path - self.source = self.source_class(self.settings, source=source, - source_path=source_path) + self.source = self.source_class( + source=source, source_path=source_path, + encoding=self.settings.input_encoding) def set_destination(self, destination=None, destination_path=None): if destination_path is None: @@ -146,8 +147,8 @@ class Publisher: else: self.settings._destination = destination_path self.destination = self.destination_class( - self.settings, destination=destination, - destination_path=destination_path) + destination=destination, destination_path=destination_path, + encoding=self.settings.output_encoding) def apply_transforms(self, document): document.transformer.populate_from_components( diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index b9409aca8..cc8019886 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -30,7 +30,8 @@ def include(name, arguments, options, content, lineno, path = os.path.normpath(os.path.join(source_dir, path)) path = utils.relative_path(None, path) try: - include_file = io.FileInput(state.document.settings, source_path=path) + include_file = io.FileInput( + source_path=path, encoding=state.document.settings.input_encoding) except IOError, error: severe = state_machine.reporter.severe( 'Problems with "%s" directive path:\n%s.' % (name, error), diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index 822a45946..f33086be9 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -46,7 +46,7 @@ from docutils import frontend, nodes, statemachine, urischemes, utils from docutils.transforms import universal from docutils.parsers import rst from docutils.parsers.rst import states, tableparser, directives, languages -from docutils.readers import pep +from docutils.readers import standalone, pep, pysource from docutils.statemachine import string2lines try: diff --git a/docutils/tools/buildhtml.py b/docutils/tools/buildhtml.py index 9486229de..c304c6618 100755 --- a/docutils/tools/buildhtml.py +++ b/docutils/tools/buildhtml.py @@ -24,7 +24,7 @@ import os.path import copy import docutils from docutils import ApplicationError -from docutils import core, frontend, io +from docutils import core, frontend from docutils.parsers import rst from docutils.readers import standalone, pep from docutils.writers import html4css1, pep_html diff --git a/sandbox/richard/ZReST/ZReST.py b/sandbox/richard/ZReST/ZReST.py index 0add4a3a2..e130cf18e 100644 --- a/sandbox/richard/ZReST/ZReST.py +++ b/sandbox/richard/ZReST/ZReST.py @@ -180,11 +180,12 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): pub.settings.warning_stream = Warnings() # input - pub.source = docutils.io.StringInput(pub.settings) - pub.source.source = self.source + pub.source = docutils.io.StringInput( + source=self.source, encoding=pub.settings.input_encoding) # output - not that it's needed - pub.destination = docutils.io.StringOutput(pub.settings) + pub.destination = docutils.io.StringOutput( + encoding=pub.settings.output_encoding) # parse! document = pub.reader.read(pub.source, pub.parser, pub.settings) @@ -264,6 +265,9 @@ modulesecurity.apply(globals()) # # $Log$ +# Revision 1.6 2002/11/28 03:44:50 goodger +# updated +# # Revision 1.5 2002/11/05 05:27:56 goodger # fixed Reader name # diff --git a/sandbox/tibs/pysource/visit.py b/sandbox/tibs/pysource/visit.py index 8d72d7ddf..ec5a2992f 100755 --- a/sandbox/tibs/pysource/visit.py +++ b/sandbox/tibs/pysource/visit.py @@ -2046,7 +2046,7 @@ class ImportName(Name): # ---------------------------------------------------------------------- def test_parse_module(filename): print "Reading file %s"%filename - return Module(filename,verbose=1) + return Module(filename,debug=0) def test_show_ast(thing): print @@ -2067,8 +2067,8 @@ def test(): return filename = sys.argv[1] thing = test_parse_module(filename) - #test_show_ast(thing) - #test_show_scopes(thing) + test_show_ast(thing) + test_show_scopes(thing) if __name__ == "__main__": test() |
