Jump to >

reviewboard.diffviewer.opcode_generator

class MoveRange(start, end, groups=[])[source]

Bases: object

Stores information on a move range.

This will store the start and end of the range, and all groups that are a part of it.

__init__(start, end, groups=[])[source]

x.__init__(…) initializes x; see help(type(x)) for signature

last_group[source]
add_group(group, group_index)[source]
__repr__() <==> repr(x)[source]
class DiffOpcodeGenerator(differ, diff=None, interdiff=None)[source]

Bases: object

ALPHANUM_RE = <_sre.SRE_Pattern object>[source]
WHITESPACE_RE = <_sre.SRE_Pattern object>[source]
MOVE_PREFERRED_MIN_LINES = 2[source]
MOVE_MIN_LINE_LENGTH = 20[source]
TAB_SIZE = 8[source]
__init__(differ, diff=None, interdiff=None)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

__iter__()[source]

Returns opcodes from the differ with extra metadata.

This is a wrapper around a differ’s get_opcodes function, which returns extra metadata along with each range. That metadata includes information on moved blocks of code and whitespace-only lines.

This returns a list of opcodes as tuples in the form of (tag, i1, i2, j1, j2, meta).

get_diff_opcode_generator_class()[source]

Returns the DiffOpcodeGenerator class used for generating opcodes.

set_diff_opcode_generator_class(renderer)[source]

Sets the DiffOpcodeGenerator class used for generating opcodes.

get_diff_opcode_generator(*args, **kwargs)[source]

Returns a DiffOpcodeGenerator instance used for generating opcodes.