def test_executable(self) -> None: "Check to see if the TiddlyWiki executable provided can be called from Anki." # pylint: disable=no-member QApplication.setOverrideCursor(QCursor(Qt.CursorShape.WaitCursor)) try: args = [self.form.tiddlywikiBinary_.text(), "--version"] proc = subprocess.run(args, check=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, startupinfo=nowin_startupinfo()) except FileNotFoundError: QApplication.restoreOverrideCursor() showCritical( "It doesn't look like that file exists on your computer. " "Try using the full path to 'tiddlywiki'.") except subprocess.CalledProcessError as e: QApplication.restoreOverrideCursor() showCritical( f"It's not quite working yet. Try seeing if you can run TiddlyWiki " f"from the command line and copy your command in here.\n\n" f"{e.output}") except Exception: QApplication.restoreOverrideCursor() raise else: QApplication.restoreOverrideCursor() showInfo( f"Successfully called TiddlyWiki {proc.stdout.decode().strip()}! " f"You're all set.")
def darrowTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Darrow)
def lineTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Line)
def polygonTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Polygon)
def ellipseTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Ellipse)
def rectTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Rect)
def zoomTool(self): QApplication.setOverrideCursor(Qt.ArrowCursor) self.changeMode(ToolMode.Zoom)
def moveTool(self): QApplication.setOverrideCursor(Qt.SizeAllCursor) self.changeMode(ToolMode.Move)