33 |
|
|
34 |
# Because docutils' own relative path has problems with |
# Because docutils' own relative path has problems with |
35 |
# paths beginning with '../', we use our own :-) |
# paths beginning with '../', we use our own :-) |
36 |
import utils.path |
import util.path |
37 |
docutils.utils.relative_path = utils.path.relative_path |
docutils.utils.relative_path = util.path.relative_path |
38 |
|
|
39 |
|
class DocutilsException(Exception): |
40 |
|
def __init__(self, system_message): |
41 |
|
self.value = system_message.astext() |
42 |
|
Exception.__init__(self, self.value) |
43 |
|
def __str__(self): |
44 |
|
return self.value |
45 |
|
|
46 |
def docutils_system_message(self, level, message, *children, **kwargs): |
def docutils_system_message(self, level, message, *children, **kwargs): |
47 |
""" |
""" |
76 |
self.notify_observers(msg) |
self.notify_observers(msg) |
77 |
return msg |
return msg |
78 |
docutils.utils.Reporter.system_message = docutils_system_message |
docutils.utils.Reporter.system_message = docutils_system_message |
79 |
|
docutils.utils.SystemMessage = DocutilsException |
80 |
|
|
81 |
class Element: |
class Element: |
82 |
""" |
""" |