diff options
author | necoro <> | 2007-01-24 22:15:27 +0000 |
---|---|---|
committer | necoro <> | 2007-01-24 22:15:27 +0000 |
commit | 3a1d0db1f30133bae568341428d427cf5a5d0495 (patch) | |
tree | f9d77762827ab71dea40d9d78513806da1fcc7fc /portato.py | |
parent | c7e0ba131ab7169573dc0278f4ea3b19c13e9e26 (diff) | |
download | portato-3a1d0db1f30133bae568341428d427cf5a5d0495.tar.gz portato-3a1d0db1f30133bae568341428d427cf5a5d0495.tar.bz2 portato-3a1d0db1f30133bae568341428d427cf5a5d0495.zip |
- Added icons
- Added support for killing the process
- Reorganised setup and starting-script
Diffstat (limited to 'portato.py')
-rwxr-xr-x | portato.py | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -12,12 +12,12 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -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 <necoro@necoro.net>""" % 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() |