8 format
= '%(levelname) -8s %(message)s',
18 from optparse
import OptionParser
20 from ttime
.localize
import _
23 from ttime
import logic
24 from ttime
import prefs
26 class MainWindowStarter
:
27 def start_main_window(self
):
28 logging
.debug("Parsing REPY data")
30 logic
.repy
.parse_repy_data()
32 logging
.debug("Data has been downloaded, starting main window")
33 self
.main_window
= gui
.MainWindow()
36 self
.repy_data
= logic
.data
.repy_data()
39 gui
.ProgressDialog(_("Downloading REPY data"), self
.get_data
,
40 self
.start_main_window
)
44 def show_parsed_repy():
46 w
.set_default_size(600,600)
47 s
= gtk
.ScrolledWindow()
50 tv
.modify_font(pango
.FontDescription ("Mono"))
52 s
.set_policy(gtk
.POLICY_NEVER
, gtk
.POLICY_ALWAYS
)
53 tb
.set_text(logic
.data
.repy_data())
56 w
.connect('destroy',gtk
.main_quit
)
59 if __name__
== '__main__':
60 parser
= OptionParser("usage: %prog { -c }")
61 parser
.add_option("-c", "--cache", dest
="usecache", help="Use cached REPY",
62 default
= False, action
="store_true")
63 parser
.add_option("-p", "--parse", dest
="do_parsing", help="Actually parse",
64 default
= False, action
="store_true")
65 parser
.add_option("-v", "--view_repy", dest
="viewrepy", help="Jusy show the REPY file",
66 default
= False, action
="store_true")
67 (options
,args
) = parser
.parse_args()
68 prefs
.options
= options
73 m
= MainWindowStarter()