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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#
# $Id: GUI.py,v 1.2 1999/12/16 09:36:49 rob Exp $
#
# Copyright 1999 Rob Tillotson <robt@debian.org>
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee or royalty is
# hereby granted, provided that the above copyright notice appear in
# all copies and that both the copyright notice and this permission
# notice appear in supporting documentation or portions thereof,
# including modifications, that you you make.
#
# THE AUTHOR ROB TILLOTSON DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE!
#
"""
"""
__version__ = '$Id: GUI.py,v 1.2 1999/12/16 09:36:49 rob Exp $'
__copyright__ = 'Copyright 1999 Rob Tillotson <robt@debian.org>'
from Sulfur.Plugin import Plugin
system_names = ['tk']
def test_system(s):
"""Test for the existence of a particular GUI system.
"""
if s == 'tk':
try:
import Tkinter
return 1
except:
pass
# everything else I have on my system...
# elif s == 'pmw':
# try:
# import Pmw
# return 1
# except:
# pass
# elif s == 'gtk':
# try:
# import gtk
# return 1
# except:
# pass
# elif s == 'gnome':
# try:
# import gnome
# return 1
# except:
# pass
# elif s == 'wxwin':
# try:
# import wxPython
# return 1
# except:
# pass
return None
def test_systems(l):
"""Test for several GUI systems, and return the first match.
"""
for s in l:
if test_system(s): return s
# The GUI API
class GUISystem(Plugin):
type = 'GUI'
|