76
76
import tkinter .filedialog as tkFileDialog
77
77
import tkinter .colorchooser as tkColorChooser
78
78
import tkinter as Tkinter
79
+ from shutil import which
79
80
else :
80
81
import tkSimpleDialog
81
82
import tkMessageBox
82
83
import tkFileDialog
83
84
import tkColorChooser
84
85
import Tkinter
86
+ which = lambda cmd : None
85
87
86
88
# pymol lib
87
89
try :
92
94
sys .exit (1 )
93
95
94
96
# 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
100
98
101
99
VERBOSE = True
102
100
@@ -132,7 +130,7 @@ def __init__(self, app):
132
130
Pmw .setbusycursorattributes (self .dialog .component ('hull' ))
133
131
134
132
# parameters used by DSSP
135
- self .pymol_sel = Tkinter .StringVar ()
133
+ self .pymol_sel = Tkinter .StringVar (value = "all" )
136
134
self .dssp_bin = Tkinter .StringVar ()
137
135
self .stride_bin = Tkinter .StringVar ()
138
136
self .dssp_rlt_dict = {}
@@ -161,7 +159,7 @@ def __init__(self, app):
161
159
else :
162
160
if VERBOSE :
163
161
print ('DSSP_BIN not found in environmental variables.' )
164
- self .dssp_bin .set ('' )
162
+ self .dssp_bin .set (which ( 'mkdssp' ) or '' )
165
163
if 'STRIDE_BIN' not in os .environ and 'PYMOL_GIT_MOD' in os .environ :
166
164
if sys .platform .startswith ('linux' ) and platform .machine () == 'x86_32' :
167
165
initialdir_stride = os .path .join (os .environ ['PYMOL_GIT_MOD' ], "Stride" , "i86Linux2" , "stride" )
@@ -181,7 +179,7 @@ def __init__(self, app):
181
179
else :
182
180
if VERBOSE :
183
181
print ('STRIDE_BIN not found in environmental variables.' )
184
- self .stride_bin .set ('' )
182
+ self .stride_bin .set (which ( 'stride' ) or '' )
185
183
186
184
# DSSP visualization color
187
185
# - H Alpha helix (4-12)
0 commit comments