Skip to content

Commit 3fc9c0d

Browse files
committed
common/iniinfo -add/improve checks for valid program/subroutine paths
1 parent 91c1677 commit 3fc9c0d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/python/common/iniinfo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ def update(self):
6969
self.PREFERENCE_PATH = self.INI.getstring("DISPLAY", "PREFERENCE_FILE_PATH") # or None
7070
self.PROGRAM_PREFIX = self.get_error_safe_setting("DISPLAY", "PROGRAM_PREFIX", '~/linuxcnc/nc_files')
7171

72-
if not os.path.exists(os.path.expanduser(self.PROGRAM_PREFIX)):
73-
LOG.warning('Path not valid in INI File [DISPLAY] PROGRAM_PREFIX section')
72+
temp = os.path.expanduser(self.PROGRAM_PREFIX)
73+
if not os.path.exists(temp):
74+
LOG.warning(f'Path not valid in INI File [DISPLAY] PROGRAM_PREFIX section: {temp}')
7475

7576
temp = self.INI.getstring("DISPLAY", "USER_COMMAND_FILE")
7677
if not temp is None:
@@ -83,6 +84,9 @@ def update(self):
8384
self.SUB_PATH = self.INI.getstring("RS274NGC", "SUBROUTINE_PATH") # or None
8485
if self.SUB_PATH is not None:
8586
for mpath in (self.SUB_PATH.split(':')):
87+
temp = os.path.expanduser(mpath)
88+
if not os.path.exists(temp):
89+
LOG.warning(f'Path not valid in INI File [RS274NGC] SUBROUTINE_PATH section: {temp}')
8690
self.SUB_PATH_LIST.append(mpath)
8791
if 'macro' in mpath:
8892
path = mpath

0 commit comments

Comments
 (0)