7676 import tkinter .filedialog as tkFileDialog
7777 import tkinter .colorchooser as tkColorChooser
7878 import tkinter as Tkinter
79+ from shutil import which
7980else :
8081 import tkSimpleDialog
8182 import tkMessageBox
8283 import tkFileDialog
8384 import tkColorChooser
8485 import Tkinter
86+ which = lambda cmd : None
8587
8688# pymol lib
8789try :
9294 sys .exit (1 )
9395
9496# external lib
95- try :
96- import Pmw
97- except ImportError :
98- print ('Warning: failed to import Pmw. Exit ...' )
99- sys .exit (1 )
97+ import Pmw
10098
10199VERBOSE = True
102100
@@ -132,7 +130,7 @@ def __init__(self, app):
132130 Pmw .setbusycursorattributes (self .dialog .component ('hull' ))
133131
134132 # parameters used by DSSP
135- self .pymol_sel = Tkinter .StringVar ()
133+ self .pymol_sel = Tkinter .StringVar (value = "all" )
136134 self .dssp_bin = Tkinter .StringVar ()
137135 self .stride_bin = Tkinter .StringVar ()
138136 self .dssp_rlt_dict = {}
@@ -161,7 +159,7 @@ def __init__(self, app):
161159 else :
162160 if VERBOSE :
163161 print ('DSSP_BIN not found in environmental variables.' )
164- self .dssp_bin .set ('' )
162+ self .dssp_bin .set (which ( 'mkdssp' ) or '' )
165163 if 'STRIDE_BIN' not in os .environ and 'PYMOL_GIT_MOD' in os .environ :
166164 if sys .platform .startswith ('linux' ) and platform .machine () == 'x86_32' :
167165 initialdir_stride = os .path .join (os .environ ['PYMOL_GIT_MOD' ], "Stride" , "i86Linux2" , "stride" )
@@ -181,7 +179,7 @@ def __init__(self, app):
181179 else :
182180 if VERBOSE :
183181 print ('STRIDE_BIN not found in environmental variables.' )
184- self .stride_bin .set ('' )
182+ self .stride_bin .set (which ( 'stride' ) or '' )
185183
186184 # DSSP visualization color
187185 # - H Alpha helix (4-12)
0 commit comments