Compare commits

...

6 Commits

Author SHA1 Message Date
plc-user 148b6dd517 Merge 3cadc9275e into 22e6188bb6 2025-01-30 06:26:09 +00:00
plc-user 3cadc9275e improve readability 2025-01-30 07:25:30 +01:00
plc-user a459029f0d simplify code even more... 2025-01-30 00:15:09 +01:00
Laurent Trinques 22e6188bb6 Merge pull request #333 from plc-user/master
corrected a few places where QETApp::documentDir() should also be used
2025-01-29 14:38:25 +01:00
Laurent Trinques 9d83d3180a Merge pull request #334 from zultron/zultron/2025-01-29_Fix_snap_qet_tb_generator
build-aux/snap/snapcraft.yaml:  python3.8 -> 3.10
2025-01-29 13:31:46 +01:00
John Morris 09c87cf811 build-aux/snap/snapcraft.yaml: python3.8 -> 3.10
Fix traceback when selecting "Project" menu "Launch the terminal block
creation plugin" item:

    Traceback (most recent call last):
      File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 33, in <module>
        sys.exit(load_entry_point('qet-tb-generator==1.3.1', 'console_scripts', 'qet_tb_generator')())
      File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 25, in importlib_load_entry_point
        return next(matches).load()
      File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
        module = import_module(match.group('module'))
      File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/main.py", line 98, in <module>
        import src.PySimpleGUI as sg
      File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/PySimpleGUI.py", line 95, in <module>
        import tkinter as tk
    ModuleNotFoundError: No module named 'tkinter'
2025-01-29 00:22:17 -06:00
2 changed files with 23 additions and 38 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ apps:
environment: &env
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
HOME: $SNAP_USER_COMMON
PYTHONPATH: $SNAP:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3.8:$SNAP/usr/lib/python3.8/lib-dynload
PYTHONPATH: $SNAP:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3.10:$SNAP/usr/lib/python3.10/lib-dynload
qet-tb-generator:
command: bin/qet_tb_generator
+22 -37
View File
@@ -2354,56 +2354,41 @@ void QETDiagramEditor::generateTerminalBlock()
#endif
bool success = false;
QList<QString> exeList;
QProcess *process = new QProcess(qApp);
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
exeList << QStandardPaths::findExecutable("qet_tb_generator.exe")
<< "qet_tb_generator"
<< (QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe")
<< (QETApp::dataDir() + "/binary/qet_tb_generator.exe");
#elif defined(Q_OS_MACOS)
exeList << QStandardPaths::findExecutable("qet_tb_generator")
<< "/Library/Frameworks/Python.framework/Versions/3.11/bin/qet_tb_generator"
<< (QDir::homePath() + "/.qet/qet_tb_generator.app")
<< (QETApp::dataDir() + "/binary/qet_tb_generator");
#else
exeList << QStandardPaths::findExecutable("qet_tb_generator")
<< (QETApp::dataDir() + "/binary/qet_tb_generator")
<< (QDir::homePath() + "/.qet/qet_tb_generator")
<< "qet_tb_generator";
#endif
// If launched under control:
//connect(process, SIGNAL(errorOcurred(int error)), this, SLOT(slot_generateTerminalBlock_error()));
//process->start("qet_tb_generator");
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
qInfo() << " project to use for qet_tb_generator: "
<< (QETDiagramEditor::currentProjectView()->project()->filePath());
if (openedProjects().count()) {
QList<QString> exeList;
exeList << QStandardPaths::findExecutable("qet_tb_generator.exe")
<< "qet_tb_generator"
<< (QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe")
<< (QETApp::dataDir() + "/binary/qet_tb_generator.exe");
foreach(QString exe, exeList) {
qInfo() << " success so far: " << success << " - now searching for " << exe;
if ((success == false) && exe.length() && QFile::exists(exe)) {
success = process->startDetached(exe, {(QETDiagramEditor::currentProjectView()->project()->filePath())});
}
}
}
#elif defined(Q_OS_MACOS)
if (openedProjects().count()) {
QList<QString> exeList;
exeList << QStandardPaths::findExecutable("qet_tb_generator")
<< "/Library/Frameworks/Python.framework/Versions/3.11/bin/qet_tb_generator"
<< (QDir::homePath() + "/.qet/qet_tb_generator.app")
<< (QETApp::dataDir() + "/binary/qet_tb_generator");
foreach(QString exe, exeList) {
qInfo() << " success so far: " << success << " - now searching for " << exe;
if ((success == false) && exe.length() && QFile::exists(exe)) {
success = process->startDetached(exe, {(QETDiagramEditor::currentProjectView()->project()->filePath())});
}
}
}
#else
if (openedProjects().count()) {
QList<QString> exeList;
exeList << QStandardPaths::findExecutable("qet_tb_generator")
<< (QETApp::dataDir() + "/binary/qet_tb_generator")
<< (QDir::homePath() + "/.qet/qet_tb_generator")
<< "qet_tb_generator";
foreach(QString exe, exeList) {
qInfo() << " success so far: " << success << " - now searching for " << exe;
if ((success == false) && exe.length() && QFile::exists(exe)) {
success = process->startDetached(exe, {(QETDiagramEditor::currentProjectView()->project()->filePath())});
}
}
}
#endif
else {
} else {
qInfo() << "No project loaded - no need to start \"qet_tb_generator\"";
}
process->close();