[LinuxCNC/linuxcnc PR#187] bugfix 2.7/2.8: gscreen.py, os.symlink: local_theme -> userthemedir

未分类 bolang 4个月前 (10-15) 21次浏览

Issue #187 | 状态: 已关闭 | 作者: tseufl | 创建时间: 2016-10-22


Signed-off-by: Thoren Seufl t_seufl@gmx.de


评论 (3)

#1 – SebKuzminsky 于 2016-10-23

There’s definitely a bug in gscreen before this PR, but I think the PR fixes the bug in the wrong way.

Before this PR (in 2.7), gscreen crashes if the userthemedir doesn’t exist. But this PR makes it so it only creates the symlink if the symlink already exists. I think it should create the directory if it doesn’t exist, then create the symlink if it doesn’t exist.

@c-morley, do you have thoughts on this?


#2 – tseufl 于 2016-10-23

@SebKuzminsky

gscreen current version with a few extra debug lines from me:

Starting DISPLAY program: gscreen
*\* GSCREEN INFO: audio available!
*\* GSCREEN INFO: Skin name = gaxis
*\* GSCREEN INFO: Skin name =
\ GSCREEN INFO: Using SKIN glade file from /usr/share/gscreen/skins/gaxis/gaxis.glade **
*\* GSCREEN INFO: No Screen 2 glade file present
adding import dir /usr/share/gscreen/skins/gaxis
module ‘gaxis_handler’ imported OK
module ‘gaxishandler’ : ‘gethandlers’ function found
tseufl-Debug:-# get the system wide theme
tseufl-Debug:-self.data.system_theme: Xfce
tseufl-Debug:-# check for a local theme gtkrc file
tseufl-Debug:-localtheme: /home/thoren/linuxcnc/configs/sim.gscreen.gscreencustom/gaxistheme
tseufl-Debug:-if os.path.exists(localtheme) -> result is true
tseufl-Debug:—-self.data.localtheme:Link to gaxistheme
tseufl-Debug:—-# create systemlink because one can’t store themes in an arbitrary folder.
tseufl-Debug:—-userthemedir=/home/thoren/.themes
tseufl-Debug:—-self.data.localtheme=Link to gaxistheme
tseufl-Debug:—-tempstring=userthemedir+’/%s’%self.data.localtheme
tseufl-Debug:—-tempstring=/home/thoren/.themes/Link to gaxistheme
tseufl-Debug:—-if not os.path.exists(userthemedir+’/%s’%self.data.local_theme) -> result is true
tseufl-Debug:——-os.symlink(localtheme,userthemedir+’/%s’%self.data.local_theme) -> result is program abort

To remove the “not” is to prevent only a temporary solution to the program termination.

Yes i see it also as that previously still to be checked separately whether “userthemedir” is actually already exists (and will if necessary created) and the following test with “not” would be right to apply to the missing symlink.


#3 – c-morley 于 2018-07-03

I’m closing this – I believe it is fixed with b29052. If not please reopen.


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/187

喜欢 (0)