Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
466c94d5
Commit
466c94d5
authored
Feb 01, 2003
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed debug print
- added env. variables for input/output encodings
parent
f2b0ecee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
lib/python/reStructuredText/__init__.py
lib/python/reStructuredText/__init__.py
+8
-9
No files found.
lib/python/reStructuredText/__init__.py
View file @
466c94d5
...
@@ -17,9 +17,14 @@ __all__ = ["HTML" ]
...
@@ -17,9 +17,14 @@ __all__ = ["HTML" ]
import
docutils.core
import
docutils.core
from
docutils.io
import
StringOutput
,
StringInput
from
docutils.io
import
StringOutput
,
StringInput
import
sys
import
sys
,
os
default_input_encoding
=
os
.
environ
.
get
(
"REST_INPUT_ENCODING"
,
sys
.
getdefaultencoding
())
default_output_encoding
=
os
.
environ
.
get
(
"REST_OUTPUT_ENCODING"
,
sys
.
getdefaultencoding
())
class
Warnings
:
class
Warnings
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
messages
=
[]
self
.
messages
=
[]
...
@@ -28,7 +33,8 @@ class Warnings:
...
@@ -28,7 +33,8 @@ class Warnings:
def
HTML
(
src
,
writer
=
'html4zope'
,
report_level
=
1
,
stylesheet
=
'default.css'
,
def
HTML
(
src
,
writer
=
'html4zope'
,
report_level
=
1
,
stylesheet
=
'default.css'
,
input_encoding
=
None
,
output_encoding
=
None
):
input_encoding
=
default_input_encoding
,
output_encoding
=
default_output_encoding
):
""" render HTML from a reStructuredText string
""" render HTML from a reStructuredText string
- 'src' -- string containing a valid reST document
- 'src' -- string containing a valid reST document
...
@@ -44,12 +50,6 @@ def HTML(src, writer='html4zope', report_level=1, stylesheet='default.css',
...
@@ -44,12 +50,6 @@ def HTML(src, writer='html4zope', report_level=1, stylesheet='default.css',
pub
.
set_reader
(
'standalone'
,
None
,
'restructuredtext'
)
pub
.
set_reader
(
'standalone'
,
None
,
'restructuredtext'
)
pub
.
set_writer
(
writer
)
pub
.
set_writer
(
writer
)
if
input_encoding
is
None
:
input_encoding
=
sys
.
getdefaultencoding
()
if
output_encoding
is
None
:
output_encoding
=
sys
.
getdefaultencoding
()
# go with the defaults
# go with the defaults
pub
.
get_settings
()
pub
.
get_settings
()
...
@@ -78,6 +78,5 @@ def HTML(src, writer='html4zope', report_level=1, stylesheet='default.css',
...
@@ -78,6 +78,5 @@ def HTML(src, writer='html4zope', report_level=1, stylesheet='default.css',
warnings
=
''
.
join
(
pub
.
settings
.
warning_stream
.
messages
)
warnings
=
''
.
join
(
pub
.
settings
.
warning_stream
.
messages
)
# do the format
# do the format
print
pub
.
writer
.
write
(
document
,
pub
.
destination
)
return
pub
.
writer
.
write
(
document
,
pub
.
destination
)
return
pub
.
writer
.
write
(
document
,
pub
.
destination
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment