Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.target should be self._target #25

Closed
ghost opened this issue Nov 10, 2016 · 2 comments
Closed

self.target should be self._target #25

ghost opened this issue Nov 10, 2016 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 10, 2016

class Match(Region):
""" Extended Region object with additional data on click target, match score """
def init(self, score, target, rect):
super(Match, self).init(rect[0][0], rect[0][1], rect[1][0], rect[1][1])
self._score = float(score)
if not target or not isinstance(target, Location):
raise TypeError("Match expected target to be a Location object")
self._target = target

def getScore(self):
	""" Returns confidence score of the match """
	return self._score

def getTarget(self):
	""" Returns the location of the match click target (center by default, but may be offset) """
	return self.getCenter().offset(self._target.x, self._target.y)

def __repr__(self):
	return "Match[{},{} {}x{}] score={.2f}, target={}".format(self.x, self.y, self.w, self.h, self._score, **# self.target.getTuple())**
@glitchassassin
Copy link
Owner

This has been patched in a development branch and will be rolled out to master in the near future.

glitchassassin added a commit that referenced this issue Nov 10, 2016
Updated documentation and fixed Region's __repr__ method
@glitchassassin glitchassassin mentioned this issue Nov 10, 2016
@glitchassassin
Copy link
Owner

Released v0.4.1a1 with this hotfix and updated Pypi. The new version should be available for update shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant