/usr/lib/python2.7/dist-packages/ginga/toolkit.py is in python-ginga 2.6.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | #
# toolkit.py -- module for customizing Ginga GUI toolkit version
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
toolkit = 'choose'
family = None
class ToolKitError(Exception):
pass
def use(name):
"""
Set the name of the GUI toolkit we should use.
"""
global toolkit, family
name = name.lower()
if name.startswith('choose'):
pass
elif name.startswith('qt') or name.startswith('pyside'):
family = 'qt'
if name == 'qt':
name = 'qt4'
assert name in ('qt4', 'pyside', 'qt5'), \
ToolKitError("ToolKit '%s' not supported!" % (name))
elif name.startswith('gtk'):
if name in ('gtk', 'gtk2'):
name = 'gtk2'
family = 'gtk'
elif name in ('gtk3',):
family = 'gtk3'
assert name in ('gtk2', 'gtk3'), \
ToolKitError("ToolKit '%s' not supported!" % (name))
elif name.startswith('tk'):
family = 'tk'
assert name in ('tk', ), \
ToolKitError("ToolKit '%s' not supported!" % (name))
elif name.startswith('pg'):
family = 'pg'
assert name in ('pg', ), \
ToolKitError("ToolKit '%s' not supported!" % (name))
else:
ToolKitError("ToolKit '%s' not supported!" % (name))
toolkit = name
def get_toolkit():
return toolkit
def get_family():
return family
def get_rv_toolkits():
"""Returns a list of reference viewer supported toolkits."""
return ['qt4', 'qt5', 'pyside', 'gtk2', 'gtk3', 'pg']
#END
|