travis fix

This commit is contained in:
Luke Campagnola 2014-03-30 02:16:05 -04:00
parent b154c6d997
commit 5d5ea065a4
2 changed files with 19 additions and 8 deletions

View File

@ -144,7 +144,7 @@ script:
# Run unit tests
- start_test "unit tests";
PYTHONPATH=. ${PYTEST} pyqtgraph/
PYTHONPATH=. ${PYTEST} pyqtgraph/;
check_output "unit tests";
@ -171,12 +171,12 @@ script:
# Check double-install fails
# Note the bash -c is because travis strips off the ! otherwise.
- start_test "double install test";
bash -c "! sudo python${PYTHON} setup.py --quiet install"
bash -c "! sudo python${PYTHON} setup.py --quiet install";
check_output "double install test";
# Check we can import pg
- start_test "import test";
echo "import sys; print(sys.path)" | python;
echo "import sys; print(sys.path)" | python &&
cd /; echo "import pyqtgraph.examples" | python;
check_output "import test";

View File

@ -131,8 +131,12 @@ class MouseDragEvent(object):
return self.finish
def __repr__(self):
lp = self.lastPos()
p = self.pos()
if self.currentItem is None:
lp = self._lastScenePos
p = self._scenePos
else:
lp = self.lastPos()
p = self.pos()
return "<MouseDragEvent (%g,%g)->(%g,%g) buttons=%d start=%s finish=%s>" % (lp.x(), lp.y(), p.x(), p.y(), int(self.buttons()), str(self.isStart()), str(self.isFinish()))
def modifiers(self):
@ -222,7 +226,10 @@ class MouseClickEvent(object):
def __repr__(self):
try:
p = self.pos()
if self.currentItem is None:
p = self._scenePos
else:
p = self.pos()
return "<MouseClickEvent (%g,%g) button=%d>" % (p.x(), p.y(), int(self.button()))
except:
return "<MouseClickEvent button=%d>" % (int(self.button()))
@ -348,8 +355,12 @@ class HoverEvent(object):
return Point(self.currentItem.mapFromScene(self._lastScenePos))
def __repr__(self):
lp = self.lastPos()
p = self.pos()
if self.currentItem is None:
lp = self._lastScenePos
p = self._scenePos
else:
lp = self.lastPos()
p = self.pos()
return "<HoverEvent (%g,%g)->(%g,%g) buttons=%d enter=%s exit=%s>" % (lp.x(), lp.y(), p.x(), p.y(), int(self.buttons()), str(self.isEnter()), str(self.isExit()))
def modifiers(self):