Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
docutils.io.FileOutput Class Reference
Inheritance diagram for docutils.io.FileOutput:
Inheritance graph
[legend]
Collaboration diagram for docutils.io.FileOutput:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, destination=None, destination_path=None, encoding=None, error_handler='strict', autoclose=True, handle_io_errors=None, mode=None)
 
 open (self)
 
 write (self, data)
 
 close (self)
 
- Public Member Functions inherited from docutils.io.Output
 __repr__ (self)
 
 encode (self, data)
 
- Public Member Functions inherited from docutils.TransformSpec
 get_transforms (self)
 

Public Attributes

 opened
 
 autoclose
 
 mode
 
 destination
 
 destination_path
 
 encoding
 
- Public Attributes inherited from docutils.io.Output
 encoding
 
 error_handler
 
 destination
 
 destination_path
 
- Public Attributes inherited from docutils.TransformSpec
 default_transforms
 

Static Public Attributes

str default_destination_path = '<file>'
 
str mode = 'w'
 
- Static Public Attributes inherited from docutils.io.Output
str component_type = 'output'
 
 default_destination_path = None
 
- Static Public Attributes inherited from docutils.TransformSpec
tuple default_transforms = ()
 
tuple unknown_reference_resolvers = ()
 

Protected Attributes

 _stderr
 

Detailed Description

Output for single, simple file-like objects.

Constructor & Destructor Documentation

◆ __init__()

docutils.io.FileOutput.__init__ (   self,
  destination = None,
  destination_path = None,
  encoding = None,
  error_handler = 'strict',
  autoclose = True,
  handle_io_errors = None,
  mode = None 
)
:Parameters:
    - `destination`: either a file-like object (which is written
      directly) or `None` (which implies `sys.stdout` if no
      `destination_path` given).
    - `destination_path`: a path to a file, which is opened and then
      written.
    - `encoding`: the text encoding of the output file.
    - `error_handler`: the encoding error handler to use.
    - `autoclose`: close automatically after write (except when
      `sys.stdout` or `sys.stderr` is the destination).
    - `handle_io_errors`: ignored, deprecated, will be removed.
    - `mode`: how the file is to be opened (see standard function
      `open`). The default is 'w', providing universal newline
      support for text files.

Reimplemented from docutils.io.Output.

Reimplemented in sphinx.util.docutils.SphinxFileOutput.

Member Function Documentation

◆ write()

docutils.io.FileOutput.write (   self,
  data 
)
Write `data` to a single file, also return it.

`data` can be a `str` or `bytes` instance.
If writing `bytes` fails, an attempt is made to write to
the low-level interface ``self.destination.buffer``.

If `data` is a `str` instance and `self.encoding` and
`self.destination.encoding` are  set to different values, `data`
is encoded to a `bytes` instance using `self.encoding`.

Provisional: future versions may raise an error if `self.encoding`
and `self.destination.encoding` are set to different values.

Reimplemented from docutils.io.Output.

Reimplemented in sphinx.util.docutils.SphinxFileOutput.


The documentation for this class was generated from the following file: