[Python-checkins] python/nondist/peps/docutils/parsers/rst/directives misc.py,1.1,1.2 .cvsignore,1.1,NONE

goodger@users.sourceforge.net goodger@users.sourceforge.net
Tue, 31 Dec 2002 18:36:32 -0800


Update of /cvsroot/python/python/nondist/peps/docutils/parsers/rst/directives
In directory sc8-pr-cvs1:/tmp/cvs-serv30174/parsers/rst/directives

Modified Files:
	misc.py 
Removed Files:
	.cvsignore 
Log Message:
update from latest Docutils code

Index: misc.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/docutils/parsers/rst/directives/misc.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** misc.py	8 Nov 2002 23:47:52 -0000	1.1
--- misc.py	1 Jan 2003 02:35:59 -0000	1.2
***************
*** 12,16 ****
  import os.path
  from urllib2 import urlopen, URLError
! from docutils import nodes, statemachine, utils
  from docutils.parsers.rst import directives, states
  
--- 12,16 ----
  import os.path
  from urllib2 import urlopen, URLError
! from docutils import io, nodes, statemachine, utils
  from docutils.parsers.rst import directives, states
  
***************
*** 19,24 ****
              content_offset, block_text, state, state_machine):
      """Include a reST file as part of the content of this reST file."""
!     source_dir = os.path.dirname(
!         os.path.abspath(state.document.current_source))
      path = ''.join(arguments[0].splitlines())
      if path.find(' ') != -1:
--- 19,25 ----
              content_offset, block_text, state, state_machine):
      """Include a reST file as part of the content of this reST file."""
!     source = state_machine.input_lines.source(
!         lineno - state_machine.input_offset - 1)
!     source_dir = os.path.dirname(os.path.abspath(source))
      path = ''.join(arguments[0].splitlines())
      if path.find(' ') != -1:
***************
*** 30,34 ****
      path = utils.relative_path(None, path)
      try:
!         include_file = open(path)
      except IOError, error:
          severe = state_machine.reporter.severe(
--- 31,36 ----
      path = utils.relative_path(None, path)
      try:
!         include_file = io.FileInput(
!             source_path=path, encoding=state.document.settings.input_encoding)
      except IOError, error:
          severe = state_machine.reporter.severe(
***************
*** 37,41 ****
          return [severe]
      include_text = include_file.read()
-     include_file.close()
      if options.has_key('literal'):
          literal_block = nodes.literal_block(include_text, include_text,
--- 39,42 ----

--- .cvsignore DELETED ---