Skip to content

Commit f70196f

Browse files
committed
qtvcp -pstat: fix an error with designer loading on some systems
users would see: AttributeError: 'Path' object has no attribute 'TOUCHOFF_SUBPROGRAM' The real error was from qt_pstat.py wuth this error message bevcause linuxcnc wa not running: sys has no attribute 'argv'
1 parent a21945d commit f70196f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/python/qtvcp/qt_pstat.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,20 @@ def __init__(self):
6060
self.WIDGETUI = os.path.join(self.SHAREDIR, "widgets_ui")
6161

6262
# Linuxcnc project base directory moves when using RIP vrs installed
63-
self.BASEDIR = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
63+
try:
64+
self.BASEDIR = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
65+
except:
66+
# TODO not sure if working directory is right - this is to fix an error with designer
67+
# loading widget libraries
68+
self.BASEDIR = self.WORKINGDIR
6469
self.RIPCONFIGDIR = os.path.join(self.BASEDIR, "configs", "sim", "qtvcp_screens")
6570

6671
# python RIP library directory
6772
self.PYDIR = os.path.join(self.BASEDIR, "lib", "python")
6873
sys.path.insert(0, self.PYDIR)
6974

7075
except Exception as e:
71-
print (e)
76+
print ('qt_Pstat:',e)
7277
pass
7378

7479
def set_paths(self, filename='dummy', isscreen=False):

0 commit comments

Comments
 (0)