mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-02-02 09:54:29 +00:00
do not depend on tkinter for cmd line usage (only GUI require it)
This commit is contained in:
parent
c41470197e
commit
a91e918f01
@ -5,8 +5,11 @@
|
|||||||
# generates a default rpcpassword, twister.conf file etc.
|
# generates a default rpcpassword, twister.conf file etc.
|
||||||
# may also setup automatic twisterd script on desktop login.
|
# may also setup automatic twisterd script on desktop login.
|
||||||
|
|
||||||
from Tkinter import *
|
try:
|
||||||
from tkMessageBox import *
|
from Tkinter import *
|
||||||
|
from tkMessageBox import *
|
||||||
|
except:
|
||||||
|
pass # we will fail later, only on GUI creation
|
||||||
from subprocess import call, check_output
|
from subprocess import call, check_output
|
||||||
import csv
|
import csv
|
||||||
import operator
|
import operator
|
||||||
@ -148,7 +151,11 @@ def guiRemoveStartup():
|
|||||||
showinfo('Ok', 'Startup script removed')
|
showinfo('Ok', 'Startup script removed')
|
||||||
|
|
||||||
def createGui():
|
def createGui():
|
||||||
root = Tk()
|
try:
|
||||||
|
root = Tk()
|
||||||
|
except:
|
||||||
|
print 'Module Tkinter not found. Try installing python-tk to use GUI.'
|
||||||
|
exit(-1)
|
||||||
root.title('twister control')
|
root.title('twister control')
|
||||||
root.minsize(width=200,height=100)
|
root.minsize(width=200,height=100)
|
||||||
Button(text='Launch twister', command=guiLaunch).pack(fill=X)
|
Button(text='Launch twister', command=guiLaunch).pack(fill=X)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user