Browse Source

do not depend on tkinter for cmd line usage (only GUI require it)

miguelfreitas
Miguel Freitas 10 years ago
parent
commit
a91e918f01
  1. 7
      twister-control.py

7
twister-control.py

@ -5,8 +5,11 @@ @@ -5,8 +5,11 @@
# generates a default rpcpassword, twister.conf file etc.
# may also setup automatic twisterd script on desktop login.
try:
from Tkinter import *
from tkMessageBox import *
except:
pass # we will fail later, only on GUI creation
from subprocess import call, check_output
import csv
import operator
@ -148,7 +151,11 @@ def guiRemoveStartup(): @@ -148,7 +151,11 @@ def guiRemoveStartup():
showinfo('Ok', 'Startup script removed')
def createGui():
try:
root = Tk()
except:
print 'Module Tkinter not found. Try installing python-tk to use GUI.'
exit(-1)
root.title('twister control')
root.minsize(width=200,height=100)
Button(text='Launch twister', command=guiLaunch).pack(fill=X)

Loading…
Cancel
Save