Add some minimal docs for Diff constructor
This commit is contained in:
parent
bc7ccb6a9f
commit
ff348a2aa0
|
@ -35,8 +35,29 @@ class Diff(object):
|
|||
Core diff class. In sore need of documentation.
|
||||
"""
|
||||
|
||||
def __init__(self, old_data, new_data, columns=None, fields=None, render_field=None, render_value=None, monospace=False,
|
||||
extra_row_attrs=None):
|
||||
def __init__(self, old_data, new_data, columns=None, fields=None,
|
||||
render_field=None, render_value=None,
|
||||
monospace=False, extra_row_attrs=None):
|
||||
"""
|
||||
Constructor. You must provide the old and new data sets, and
|
||||
the set of relevant fields as well, if they cannot be easily
|
||||
introspected.
|
||||
|
||||
:param old_data: Dict of "old" data values.
|
||||
|
||||
:param new_data: Dict of "old" data values.
|
||||
|
||||
:param fields: Sequence of relevant field names. Note that
|
||||
both data dicts are expected to have keys which match these
|
||||
field names. If you do not specify the fields then they
|
||||
will (hopefully) be introspected from the old or new data
|
||||
sets; however this will not work if they are both empty.
|
||||
|
||||
:param monospace: If true, this flag will cause the value
|
||||
columns to be rendered in monospace font. This is assumed
|
||||
to be helpful when comparing "raw" data values which are
|
||||
shown as e.g. ``repr(val)``.
|
||||
"""
|
||||
self.old_data = old_data
|
||||
self.new_data = new_data
|
||||
self.columns = columns or ["field name", "old value", "new value"]
|
||||
|
|
Loading…
Reference in a new issue