Skip to content

Commit 35f1f58

Browse files
committed
Display plots as they load (#6)
1 parent 48555bd commit 35f1f58

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def __init__(self, state):
7070
w, h = 1600, 2500
7171
root.setMinimumSize(1000, h)
7272
window.resize(w, h)
73+
self.window.show()
7374

7475
def exec_(self):
75-
self.window.show()
7676
self.app.exec_()
7777

7878
def setup_widgets(self, layout):
@@ -148,7 +148,7 @@ def __init__(self):
148148
self.ui.exec_() # Run program
149149

150150
def refresh_graphs(self):
151-
self.plotter.draw(self.etterna_xml, self.replays_dir)
151+
self.plotter.draw(self.etterna_xml, self.replays_dir, self.ui.app)
152152

153153
def try_choose_replays(self):
154154
path = self.ui.choose_replays()

plotter.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, infobar):
7777

7878
self.plots = [a,b,c,d,e,f,g_,h,i,j,k,l,m]
7979

80-
def draw(self, xml_path, replays_path):
80+
def draw(self, xml_path, replays_path, qapp):
8181
print("Opening xml..")
8282
try: # First try UTF-8
8383
xmltree = etree.parse(xml_path, etree.XMLParser(encoding='UTF-8'))
@@ -96,33 +96,43 @@ def draw(self, xml_path, replays_path):
9696
next(p).draw(g.gen_textbox_text_2(xml))
9797
next(p).draw(g.gen_textbox_text_3(xml))
9898
next(p).draw(g.gen_textbox_text(xml))
99+
qapp.processEvents()
99100

100101
next(p).draw(g.gen_textbox_text_5(xml, replays))
101102
next(p).draw(g.gen_textbox_text_4(xml, replays))
103+
qapp.processEvents()
102104

103105
print("Generating wifescore plot..")
104106
next(p).draw_with_given_args(g.gen_wifescore(xml))
107+
qapp.processEvents()
105108

106109
print("Generating manip plot..")
107110
data = g.gen_manip(xml, replays) if replays else "[please load replay data]"
108111
next(p).draw_with_given_args(data)
112+
qapp.processEvents()
109113

110114
print("Generating accuracy plot..")
111115
next(p).draw_with_given_args(g.gen_accuracy(xml))
116+
qapp.processEvents()
112117

113118
print("Generating session bubble plot..")
114119
next(p).draw_with_given_args(g.gen_session_rating_improvement(xml))
120+
qapp.processEvents()
115121

116122
print("Generating plays per hour of day..")
117123
next(p).draw_with_given_args(g.gen_plays_by_hour(xml))
124+
qapp.processEvents()
118125

119126
print("Generating plays for each week..")
120127
next(p).draw_with_given_args(g.gen_plays_per_week(xml))
128+
qapp.processEvents()
121129

122130
print("Generating session skillsets..")
123131
next(p).draw_with_given_args(g.gen_session_skillsets(xml))
132+
qapp.processEvents()
124133

125134
print("Generating skillset development..")
126135
next(p).draw_with_given_args(g.gen_skillset_development(xml))
136+
qapp.processEvents()
127137

128138
print("Done")

0 commit comments

Comments
 (0)