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.")
Exemple #2
0
 def darrowTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Darrow)
Exemple #3
0
 def lineTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Line)
Exemple #4
0
 def polygonTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Polygon)
Exemple #5
0
 def ellipseTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Ellipse)
Exemple #6
0
 def rectTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Rect)
Exemple #7
0
 def zoomTool(self):
     QApplication.setOverrideCursor(Qt.ArrowCursor)
     self.changeMode(ToolMode.Zoom)
Exemple #8
0
 def moveTool(self):
     QApplication.setOverrideCursor(Qt.SizeAllCursor)
     self.changeMode(ToolMode.Move)