1 # Most of the common code needed by ROX applications is in ROX-Lib.
2 # Except this code, which is needed to find ROX-Lib in the first place!
4 # Just make sure you import findrox before importing anything inside
8 from os
.path
import exists
12 path
= os
.environ
['LIBDIRPATH']
13 paths
= string
.split(path
, ':')
15 paths
= [ os
.environ
['HOME'] + '/lib', '/usr/local/lib', '/usr/lib' ]
17 paths
= map(lambda p
: p
+'/ROX-Lib', paths
)
22 sys
.path
.append(p
+ '/python')
25 err
= "This program needs ROX-Lib to run.\nI tried all of these places:\n\n" + \
26 string
.join(paths
, '\n') + '\n\n' + "ROX-Lib is available from:\n" + \
27 "http://rox.sourceforge.net"
28 sys
.stderr
.write('*** ' + err
+ '\n')
31 win
.set_title('Missing ROX-Lib')
32 win
.set_position(WIN_POS_CENTER
)
33 message
= GtkLabel(err
)
34 message
.set_padding(20, 20)
35 win
.vbox
.pack_start(message
)
38 ok
.set_flags(CAN_DEFAULT
)
39 win
.action_area
.pack_start(ok
)
40 ok
.connect('clicked', mainquit
)
43 win
.connect('destroy', mainquit
)