From 3a1d0db1f30133bae568341428d427cf5a5d0495 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Wed, 24 Jan 2007 22:15:27 +0000 Subject: - Added icons - Added support for killing the process - Reorganised setup and starting-script --- portato.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'portato.py') diff --git a/portato.py b/portato.py index 1f77354..65cee2c 100755 --- a/portato.py +++ b/portato.py @@ -12,12 +12,12 @@ # # Written by René 'Necoro' Neumann -from portato.constants import VERSION +from portato.constants import VERSION, FRONTENDS, STD_FRONTEND import sys if __name__ == "__main__": - uimod = "gtk" + uimod = STD_FRONTEND if len(sys.argv) > 1: if sys.argv[1] in ("--help","--version","-h","-v"): @@ -30,13 +30,17 @@ There is NO WARRANTY, to the extent permitted by law. Written by René 'Necoro' Neumann """ % VERSION else: uimod = sys.argv[1] - - if uimod == "gtk": - from portato.gui.gtk import run - elif uimod == "curses": - from portato.gui.curses import run + if uimod in FRONTENDS: + try: + exec ("from portato.gui.%s import run" % uimod) + except ImportError: + print "'%s' should be installed, but cannot be imported. This is definitly a bug." % uimod + sys.exit(1) else: - print "Unknown interface %s. Correct interfaces are: gtk, curses" % uimod + print ("Unknown interface '%s'. Correct interfaces are:" % uimod) , + for u in FRONTENDS: + print u , + print sys.exit(1) run() -- cgit v1.2.3