def lineFollowRightTimed(time): u.setWait(time) while u.getWait(): if analog(c.TOPHAT) < 300: x._drive(40, 60) elif analog(c.TOPHAT) > 2400: x._drive(60, 40)
def expandAccessible(self, item): ''' Expands an accessible item. ''' if self._manualExpand or not self._active: return log.debug("Expanding device accessible item: %s" % self.device) path = self._itemPath(item) self._disableAccessibleItem(item) id = self.device.requestDevice("requestAccessible", path, 0) self._registerRequest(id, self._responseExpand) setWait(self._view.view)
def showAccessible(self): ''' Shows an accessible represented by the selected tree item. ''' if self._manualSelect: return path = self.selectedItemPath() if not path: return log.debug("Selecting device accessible item: %s" % self.device) id = self.device.requestDevice("requestAccessible", path, 0, all=True) self._registerRequest(id, self._responseRefresh) setWait(self._view.view)
def changeText(self): ''' Changes text of selected accessible item. ''' if not self._active: return path = self.selectedItemPath() if not path: return log.debug("Changing text of device accessible item: %s" % self.device) text = self._view.accessibleText() id = self.device.requestDevice("requestSetAccessible", path, text=text) self._registerRequest(id, self._responseChange) id = self.device.requestDevice("requestAccessible", path, 0, all=True) self._registerRequest(id, self._responseRefresh, True) setWait(self._view.view)
def doAction(self, button): ''' Executes action on selected accessible item. ''' if not self._active: return path = self.selectedItemPath() if not path: return log.debug("Execution action %s of device accessible item: %s" % (button.text(), self.device)) action = str(button.text()) id = self.device.requestDevice("requestDoAccessible", path, action) self._registerRequest(id, self._responseAction) id = self.device.requestDevice("requestAccessible", path, 0, all=True) self._registerRequest(id, self._responseRefresh, True) setWait(self._view.view)