Commit dac59ac5 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Sphinx extension: Don't use “from … import …”

Import with full name instead to reduce potential conflicts.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 4b163794
......@@ -26,10 +26,10 @@
import operator
from cStringIO import StringIO
from docutils import statemachine
import docutils.statemachine
from sphinx.errors import SphinxError
from sphinx.util.compat import Directive
import sphinx.errors
import sphinx.util.compat
from ganeti import utils
from ganeti import opcodes
......@@ -39,7 +39,7 @@ from ganeti import ht
COMMON_PARAM_NAMES = map(operator.itemgetter(0), opcodes.OpCode.OP_PARAMS)
class OpcodeError(SphinxError):
class OpcodeError(sphinx.errors.SphinxError):
category = "Opcode error"
......@@ -119,7 +119,7 @@ def _BuildOpcodeParams(op_id, include, exclude, alias):
yield " %s" % line
class OpcodeParams(Directive):
class OpcodeParams(sphinx.util.compat.Directive):
"""Custom directive for opcode parameters.
See also <>.
......@@ -143,8 +143,8 @@ class OpcodeParams(Directive):
include_text = "\n".join(_BuildOpcodeParams(op_id, include, exclude, alias))
# Inject into state machine
include_lines = statemachine.string2lines(include_text, tab_width,
include_lines = docutils.statemachine.string2lines(include_text, tab_width,
self.state_machine.insert_input(include_lines, path)
return []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment