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