~nick-dedekind/unity8/indicators.hint-interval

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/__init__.py

  • Committer: Nick Dedekind
  • Date: 2014-03-07 15:54:57 UTC
  • mfrom: (638.1.118 unity8)
  • Revision ID: nicholas.dedekind@gmail.com-20140307155457-f0s1zu5ll2czt3rq
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
class DragMixin(object):
52
52
    def _drag(self, x1, y1, x2, y2):
 
53
        # XXX This ugly code is here just temporarily, waiting for drag
 
54
        # improvements to land on autopilot so we don't have to access device
 
55
        # private internal attributes. --elopio - 2014-02-12
53
56
        cur_x = x1
54
57
        cur_y = y1
55
58
        dx = 1.0 * (x2 - x1) / 100
56
59
        dy = 1.0 * (y2 - y1) / 100
57
60
        for i in range(0, 100):
58
 
            self.touch._finger_move(int(cur_x), int(cur_y))
 
61
            try:
 
62
                self.touch._finger_move(int(cur_x), int(cur_y))
 
63
            except AttributeError:
 
64
                self.touch._device.finger_move(int(cur_x), int(cur_y))
59
65
            sleep(0.002)
60
66
            cur_x += dx
61
67
            cur_y += dy
62
 
        self.touch._finger_move(int(x2), int(y2))
 
68
        try:
 
69
            self.touch._finger_move(int(x2), int(y2))
 
70
        except AttributeError:
 
71
            self.touch._device.finger_move(int(x2), int(y2))