MCPcopy
hub / github.com/AirtestProject/Poco / _direction_vector_of

Method _direction_vector_of

poco/proxy.py:629–643  ·  view source on GitHub ↗
(self, dir_)

Source from the content-addressed store, hash-verified

627 return pos
628
629 def _direction_vector_of(self, dir_):
630 if dir_ == 'up':
631 dir_vec = [0, -0.1]
632 elif dir_ == 'down':
633 dir_vec = [0, 0.1]
634 elif dir_ == 'left':
635 dir_vec = [-0.1, 0]
636 elif dir_ == 'right':
637 dir_vec = [0.1, 0]
638 elif type(dir_) in (list, tuple):
639 dir_vec = dir_
640 else:
641 raise TypeError('Unsupported direction type {}. '
642 'Only "up/down/left/right" or 2-list/2-tuple available.'.format(type(dir_)))
643 return dir_vec
644
645 def wait(self, timeout=3):
646 """

Callers 1

swipeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected