mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Fixed core.engine.Match docstring
The way it was set made dupeGuru crash under Python 3.2
This commit is contained in:
parent
9ea9f60e92
commit
8e65f15e1a
@ -157,25 +157,30 @@ def reduce_common_words(word_dict, threshold):
|
||||
else:
|
||||
del word_dict[word]
|
||||
|
||||
Match = namedtuple('Match', 'first second percentage')
|
||||
Match.__doc__ = """Represents a match between two :class:`~core.fs.File`.
|
||||
# Writing docstrings in a namedtuple is tricky. From Python 3.3, it's possible to set __doc__, but
|
||||
# some research allowed me to find a more elegant solution, which is what is done here. See
|
||||
# http://stackoverflow.com/questions/1606436/adding-docstrings-to-namedtuples-in-python
|
||||
|
||||
Regarless of the matching method, when two files are determined to match, a Match pair is created,
|
||||
which holds, of course, the two matched files, but also their match "level".
|
||||
class Match(namedtuple('Match', 'first second percentage')):
|
||||
"""Represents a match between two :class:`~core.fs.File`.
|
||||
|
||||
.. attribute:: first
|
||||
Regarless of the matching method, when two files are determined to match, a Match pair is created,
|
||||
which holds, of course, the two matched files, but also their match "level".
|
||||
|
||||
.. attribute:: first
|
||||
|
||||
first file of the pair.
|
||||
|
||||
.. attribute:: second
|
||||
.. attribute:: second
|
||||
|
||||
second file of the pair.
|
||||
|
||||
.. attribute:: percentage
|
||||
.. attribute:: percentage
|
||||
|
||||
their match level according to the scan method which found the match. int from 1 to 100. For
|
||||
exact scan methods, such as Contents scans, this will always be 100.
|
||||
"""
|
||||
"""
|
||||
__slots__ = ()
|
||||
|
||||
def get_match(first, second, flags=()):
|
||||
#it is assumed here that first and second both have a "words" attribute
|
||||
|
Loading…
x
Reference in New Issue
Block a user