2
#------------------------------------------------------------------------------
5
from enthought.etsconfig.api import ETSConfig
7
print >>sys.stderr, "did you install python-chaco?"
8
print >>sys.stderr, "maybe you did install chaco>=4, then you will need to install the package etsproxy"
9
print >>sys.stderr, "sudo easy_install etsproxy"
12
# select the toolkit we want to use
13
# WX is more stable for now
14
#ETSConfig.toolkit = 'qt4'
15
ETSConfig.toolkit = 'wx'
17
# workaround bad bg color in ubuntu, with Ambiance theme
18
# wxgtk (or traitsGUI, I dont know) looks like using the menu's bgcolor
19
# for all custom widgets bg colors. :-(
21
if ETSConfig.toolkit == 'wx':
23
if "gtk2" in wx.PlatformInfo:
24
from gtk import rc_parse, MenuBar
26
if m.rc_get_style().bg[0].red_float < 0.5: # only customize dark bg
27
rc_parse(os.path.join(os.path.dirname(__file__),"images/gtkrc"))
30
# workaround bug in kiva's font manager that fails to find a correct default font on linux
35
warnings.showwarning = devnull
36
from enthought.kiva.fonttools.font_manager import fontManager, FontProperties
38
font = FontProperties()
39
font.set_name("DejaVu Sans")
40
fontManager.defaultFont = fontManager.findfont(font)
41
fontManager.warnings = None
42
except: # this code will throw exception on ETS4, which has actually fixed fontmanager
45
from enthought.pyface.api import GUI
46
from window import open_file
52
parser = optparse.OptionParser(usage="""\
53
%prog [options] [trace.txt|trace.txt.gz|trace.txt.lzma|trace.dat]
55
pytimechart - Fast graphical exploration and visualisation for linux kernel traces.""")
56
parser.add_option("-p", "--prof", dest="prof", action="store_true",
57
help="activate profiling",
59
(options, args) = parser.parse_args()
61
# Create the GUI (this does NOT start the GUI event loop).
71
cProfile.runctx('gui.start_event_loop()',dict,dict,'timechart.prof')
73
gui.start_event_loop()
75
# used for profiling, and regression tests
78
parser = optparse.OptionParser(usage="""\
79
%prog [options] [trace.txt|trace.txt.gz|trace.txt.lzma|trace.dat]
81
pytimechart_parse_test - just test parsing backend...""")
82
parser.add_option("-p", "--prof", dest="prof", action="store_true",
83
help="activate profiling",
85
(options, args) = parser.parse_args()
92
dict = {"open_file":open_file,"fn":fn}
93
cProfile.runctx('open_file(fn)',dict,dict,'timechart.prof')
97
if __name__ == '__main__':
99
import py2exe_wximports
101
##### EOF #####################################################################