Handle thumbnail creation failure according to the standard.
[rox-lib.git] / ROX-Lib2 / AppRun
blobe454dbdc1d7be78e3e3258d928531fac701fe4c0
1 #!/usr/bin/env python
3 from sys import argv, path, stderr
4 from os.path import dirname, abspath
6 app_dir = dirname(abspath(argv[0]))
7 path.append(app_dir + '/python')
9 import rox
10 from rox import g
12 message=rox._("ROX-Lib2 contains code that is useful to newer ROX applications. \
13 You should place this directory somewhere where other programs can \
14 find it, such as ~/lib or /usr/local/lib.\n\n\
15 ROX-Lib version: %s\n\
16 PyGTK version: %s\n\
17 GTK version: %s\n\n\
18 PyGTK location:\n%s") % (rox.roxlib_version, g.pygtk_version, g.gtk_version, dirname(g.__file__))
20 if rox.g.gdk.display_get_default() is not None:
21 box = g.MessageDialog(None, g.MESSAGE_QUESTION, 0, g.BUTTONS_OK, message)
22 box.add_button(g.STOCK_HELP, g.RESPONSE_HELP)
23 box.set_title('ROX-Lib')
24 box.set_position(g.WIN_POS_CENTER)
25 box.set_default_response(g.RESPONSE_OK)
27 if box.run() == int(g.RESPONSE_HELP):
28 from rox import filer
29 import os.path
30 filer.open_dir(os.path.join(app_dir, "Help"))
32 else:
33 stderr.write(message+'\n')