-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplash.py
More file actions
531 lines (466 loc) · 22.3 KB
/
Copy pathsplash.py
File metadata and controls
531 lines (466 loc) · 22.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
"""
splash.py — Cinématique de démarrage Astralis
─────────────────────────────────────────────
Lance dashboard_orbite.py en arrière-plan,
affiche la cinématique, puis se ferme dès que
le dashboard est prêt (fichier .ready_flag).
La barre or/violet reflète la progression réelle
écrite dans .splash_progress.json par le dashboard.
"""
import sys
import os
import json
import subprocess
import random
import math
from PyQt5.QtWidgets import QApplication, QWidget, QDesktopWidget
from PyQt5.QtCore import Qt, QTimer, pyqtSignal
from PyQt5.QtGui import (QPainter, QBrush, QLinearGradient, QRadialGradient,
QColor, QFont, QFontMetrics, QPen, QPixmap, QIcon)
# ── Chemins ───────────────────────────────────────────────────────────────────
if getattr(sys, 'frozen', False):
APP_DIR = os.path.dirname(sys.executable)
_BUNDLE_DIR = getattr(sys, '_MEIPASS', APP_DIR)
else:
APP_DIR = os.path.dirname(os.path.abspath(__file__))
_BUNDLE_DIR = APP_DIR
DASHBOARD = os.path.join(APP_DIR, 'dashboard_orbite.py')
READY_FLAG = os.path.join(APP_DIR, '.ready_flag')
PROGRESS_FILE = os.path.join(APP_DIR, '.splash_progress.json')
LOGO_FILENAMES = (
'astralis_logo.png', 'astralis_logo.jpg', 'astralis_logo.ico',
'logo.png', 'logo.jpg', 'icon.png', 'icon.ico',
)
def _logo_candidate_paths():
dirs = [APP_DIR]
if _BUNDLE_DIR != APP_DIR:
dirs.append(_BUNDLE_DIR)
for name in LOGO_FILENAMES:
for directory in dirs:
path = os.path.join(directory, name)
if os.path.isfile(path):
yield path
def _load_logo_pixmap(max_size: int = None):
for path in _logo_candidate_paths():
pix = QPixmap(path)
if pix.isNull():
continue
if max_size:
pix = pix.scaled(max_size, max_size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
return pix
return None
# ── Nettoyage fichiers résiduels ───────────────────────────────────────────────
for _f in (READY_FLAG, PROGRESS_FILE):
if os.path.isfile(_f):
os.remove(_f)
# ── Icône ─────────────────────────────────────────────────────────────────────
def _build_icon() -> QIcon:
pix = _load_logo_pixmap()
if pix is not None and not pix.isNull():
icon = QIcon()
for sz in (16, 32, 48, 64, 128, 256):
icon.addPixmap(pix.scaled(sz, sz, Qt.KeepAspectRatioByExpanding,
Qt.SmoothTransformation))
return icon
return QIcon()
# ── Palette Astralis — thème spatial (accord avec le site web) ───────────────
VOID_BG = "#03030A" # noir spatial profond
VOID_TOP = "#01010A" # presque absolu
GOLD = "#FFD166" # or stellaire — accent principal
VIOLET = "#9B5DE5" # violet nébuleux — accent secondaire
PINK_NEB = "#C450A0" # rose nébuleuse — profondeur
TEXT_MAIN = "#EEE8FF" # texte principal teinté lilas
TEXT_MUTE = "#8A7AAA" # texte secondaire
DEEP_VOID = "#080618" # fond très profond
class SplashWindow(QWidget):
# Vitesses des phases (ticks à ~55 fps)
_SPEED1 = 100 / 90 # fade-in logo ~1.6 s
_SPEED2 = 100 / 18 # texte ~0.33 s (rapide, chevauche le logo)
_TEXT_START = 8 # % logo avant apparition du texte
@staticmethod
def _ease_out(t: float) -> float:
t = max(0.0, min(1.0, t))
return 1.0 - (1.0 - t) ** 3
def __init__(self):
super().__init__()
self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
screen = QDesktopWidget().screenGeometry()
self._W = screen.width()
self._H = screen.height()
self.resize(self._W, self._H)
self.move(screen.left(), screen.top())
self.showFullScreen()
self._shooting_stars = []
self._shooting_cooldown = 0
# Étoiles
rng = random.Random(42)
self._stars = [
(rng.randint(0, self._W), rng.randint(0, self._H),
rng.uniform(0.5, 2.8), rng.uniform(0.3, 1.0))
for _ in range(320)
]
self._twinkling = {rng.randint(0, 319): rng.uniform(0.02, 0.08)
for _ in range(40)}
self._tick_count = 0
# Phases visuelles (logo + titre) + chargement réel (barre)
self._phase = 0.0
self._phase2 = 0.0
self._load_progress = 0.0
self._load_stage = "Lancement du tableau de bord..."
self._anim_done = False # intro logo/titre terminée
self._dash_ready = False # dashboard prêt
self._closing = False
# Logo
logo_size = int(min(self._W, self._H) * 0.28)
self._logo_pix = _load_logo_pixmap(logo_size)
# Timer animation (55 fps)
self._anim_timer = QTimer(self)
self._anim_timer.setInterval(18)
self._anim_timer.timeout.connect(self._tick)
self._anim_timer.start()
# Timer surveillance du flag "dashboard prêt" (toutes les 200 ms)
self._flag_timer = QTimer(self)
self._flag_timer.setInterval(200)
self._flag_timer.timeout.connect(self._check_ready)
self._flag_timer.start()
# Lancement du dashboard en arrière-plan
self._launch_dashboard()
# ── Lancement dashboard ───────────────────────────────
def _launch_dashboard(self):
python = sys.executable
try:
subprocess.Popen(
[python, DASHBOARD, '--splash'],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
creationflags=getattr(subprocess, 'CREATE_NO_WINDOW', 0),
)
except Exception as e:
print(f"[splash] Erreur lancement dashboard : {e}")
# ── Surveillance flag / progression ───────────────────
def _read_load_progress(self):
"""Lit la progression réelle écrite par dashboard_orbite.py."""
if not os.path.isfile(PROGRESS_FILE):
return
try:
with open(PROGRESS_FILE, "r", encoding="utf-8") as f:
data = json.load(f)
self._load_progress = float(data.get("progress", 0))
stage = (data.get("stage") or "").strip()
if stage:
self._load_stage = stage
except (OSError, json.JSONDecodeError, TypeError, ValueError):
pass
def _schedule_close(self, delay_ms: int = 300):
if self._closing:
return
if self._dash_ready and (self._phase2 >= 70.0 or self._anim_done):
self._closing = True
QTimer.singleShot(delay_ms, self._close)
def _check_ready(self):
self._read_load_progress()
if self._load_progress >= 100.0 or os.path.isfile(READY_FLAG):
self._dash_ready = True
self._load_progress = max(self._load_progress, 100.0)
self._flag_timer.stop()
self._schedule_close()
# ── Tick animation ────────────────────────────────────
def _tick(self):
self._tick_count += 1
self._read_load_progress()
if self._phase < 100:
self._phase = min(100.0, self._phase + self._SPEED1)
if self._phase >= self._TEXT_START and self._phase2 < 100:
self._phase2 = min(100.0, self._phase2 + self._SPEED2)
elif not self._anim_done:
self._anim_done = True
self._schedule_close()
if self._shooting_cooldown > 0:
self._shooting_cooldown -= 1
elif random.random() < 0.018:
angle = random.uniform(-0.6, -0.15)
speed = random.uniform(14, 28)
self._shooting_stars.append([
random.uniform(0, self._W * 0.7),
random.uniform(0, self._H * 0.45),
math.cos(angle) * speed,
math.sin(angle) * speed,
random.uniform(40, 90),
])
self._shooting_cooldown = random.randint(25, 70)
alive = []
for star in self._shooting_stars:
star[0] += star[2]
star[1] += star[3]
star[4] -= 1.2
if star[4] > 0 and star[0] < self._W + 80 and star[1] < self._H + 80:
alive.append(star)
self._shooting_stars = alive
self.update()
def _close(self):
self._anim_timer.stop()
self._flag_timer.stop()
for path in (READY_FLAG, PROGRESS_FILE):
try:
if os.path.isfile(path):
os.remove(path)
except Exception:
pass
self.close()
QApplication.instance().quit()
# ── Clic pour passer ──────────────────────────────────
def mousePressEvent(self, _event):
if not self._dash_ready:
self._phase = self._phase2 = 100.0
self._anim_done = True
else:
self._schedule_close(100)
# ── Rendu ─────────────────────────────────────────────
def paintEvent(self, _event):
p = QPainter(self)
p.setRenderHint(QPainter.Antialiasing)
p.setRenderHint(QPainter.TextAntialiasing)
W, H = self._W, self._H
# ── Layout vertical calculé ──────────────────────
font_sz = max(28, min(72, int(W / 20)))
sub_sz = max(11, min(22, int(W / 80)))
load_sz = max(9, min(16, int(W / 120)))
hint_sz = max(8, min(13, int(W / 150)))
logo_size = int(min(W, H) * 0.28)
bar_thick = max(4, int(H * 0.006))
bar_w = int(W * 0.45)
font_title = QFont("Segoe UI", font_sz, QFont.Light)
font_title.setLetterSpacing(QFont.PercentageSpacing, 155)
fm_t = QFontMetrics(font_title)
title_h = fm_t.height()
title_w = fm_t.horizontalAdvance("ASTRALIS")
font_sub = QFont("Segoe UI", sub_sz, QFont.Light)
font_sub.setLetterSpacing(QFont.PercentageSpacing, 125)
sub_h = QFontMetrics(font_sub).height()
font_load = QFont("Segoe UI", load_sz, QFont.Light)
label_h = QFontMetrics(font_load).height()
GAP1 = int(H * 0.040)
GAP2 = int(H * 0.018)
GAP3 = int(H * 0.018)
GAP4 = int(H * 0.055)
GAP5 = int(H * 0.015)
MARGE_BOT = int(H * 0.060)
bloc_h = (logo_size + GAP1 + title_h + GAP2 + 2 + GAP3 +
sub_h + GAP4 + bar_thick + GAP5 + label_h + MARGE_BOT)
y0 = max(int(H * 0.05), (H - bloc_h) // 2)
y_logo = y0
y_title = y_logo + logo_size + GAP1
y_line = y_title + title_h + GAP2
y_sub = y_line + 2 + GAP3
y_bar = y_sub + sub_h + GAP4
y_label = y_bar + bar_thick + GAP5
y_hint = H - int(MARGE_BOT * 0.4)
cx = W // 2
# ── Fond — abîme spatial ────────────────────────
bg = QLinearGradient(0, 0, 0, H)
bg.setColorAt(0.0, QColor(VOID_TOP))
bg.setColorAt(0.40, QColor(VOID_BG))
bg.setColorAt(1.0, QColor(4, 2, 16))
p.fillRect(0, 0, W, H, QBrush(bg))
# Nébuleuse violette — coin haut-droit
neb_a = QRadialGradient(W * 0.80, H * 0.12, W * 0.60)
neb_a.setColorAt(0.0, QColor(100, 30, 180, 55))
neb_a.setColorAt(0.35, QColor(60, 10, 120, 22))
neb_a.setColorAt(1.0, QColor(0, 0, 0, 0))
p.setBrush(QBrush(neb_a))
p.setPen(Qt.NoPen)
p.drawRect(0, 0, W, H)
# Nébuleuse rose — coin bas-gauche
neb_b = QRadialGradient(W * 0.18, H * 0.82, W * 0.52)
neb_b.setColorAt(0.0, QColor(160, 40, 120, 40))
neb_b.setColorAt(0.38, QColor(80, 15, 70, 18))
neb_b.setColorAt(1.0, QColor(0, 0, 0, 0))
p.setBrush(QBrush(neb_b))
p.drawRect(0, 0, W, H)
# Nébuleuse dorée — centre-haut diffuse
neb_c = QRadialGradient(W * 0.50, H * 0.28, W * 0.42)
neb_c.setColorAt(0.0, QColor(140, 90, 20, 18))
neb_c.setColorAt(0.45, QColor(60, 30, 10, 8))
neb_c.setColorAt(1.0, QColor(0, 0, 0, 0))
p.setBrush(QBrush(neb_c))
p.drawRect(0, 0, W, H)
# Nébuleuse violette profonde — centre
neb_d = QRadialGradient(W * 0.5, H * 0.5, max(W, H) * 0.38)
neb_d.setColorAt(0.0, QColor(30, 8, 60, 28))
neb_d.setColorAt(0.55, QColor(12, 4, 28, 10))
neb_d.setColorAt(1.0, QColor(0, 0, 0, 0))
p.setBrush(QBrush(neb_d))
p.drawRect(0, 0, W, H)
# Vignette sombre sur les bords
vig = QRadialGradient(W / 2, H / 2, max(W, H) * 0.72)
vig.setColorAt(0.0, QColor(0, 0, 0, 0))
vig.setColorAt(1.0, QColor(0, 0, 0, 180))
p.setBrush(QBrush(vig))
p.drawRect(0, 0, W, H)
# ── Étoiles (or / violet / blanc chaud) ─────────
star_appear = min(1.0, self._tick_count / 55)
for i, (sx, sy, sr, sa) in enumerate(self._stars):
if i in self._twinkling:
flicker = 0.5 + 0.5 * math.sin(self._tick_count * self._twinkling[i])
alpha = int(sa * 230 * star_appear * (0.3 + 0.7 * flicker))
else:
alpha = int(sa * 210 * star_appear)
if i % 5 == 0:
star_col = QColor(255, 209, 102, alpha) # or
elif i % 5 == 1:
star_col = QColor(155, 93, 229, alpha) # violet
elif i % 5 == 2:
star_col = QColor(220, 190, 255, alpha) # lilas clair
elif i % 5 == 3:
star_col = QColor(255, 230, 180, int(alpha * 0.9)) # or pâle
else:
star_col = QColor(240, 220, 255, int(alpha * 0.85)) # blanc lilas
p.setBrush(QBrush(star_col))
p.setPen(Qt.NoPen)
p.drawEllipse(int(sx - sr), int(sy - sr), int(sr * 2), int(sr * 2))
# ── Étoiles filantes (dorées avec traînée violette) ──
for sx, sy, _, _, life in self._shooting_stars:
alpha = int(min(255, life * 2.8))
size = max(2, int(2 + life * 0.04))
# Lueur dorée
glow = QRadialGradient(sx, sy, size * 3)
glow.setColorAt(0.0, QColor(255, 209, 102, alpha))
glow.setColorAt(0.5, QColor(155, 93, 229, alpha // 3))
glow.setColorAt(1.0, QColor(0, 0, 0, 0))
p.setBrush(QBrush(glow))
p.setPen(Qt.NoPen)
p.drawEllipse(int(sx - size * 3), int(sy - size * 3), size * 6, size * 6)
# Point brillant
p.setBrush(QBrush(QColor(255, 240, 180, min(255, alpha + 40))))
p.drawEllipse(int(sx - size / 2), int(sy - size / 2), size, size)
# ── Halo logo — or + violet ──────────────────────
cy_logo = y_logo + logo_size // 2
halo_r = int(logo_size * 0.90)
halo = QRadialGradient(cx, cy_logo, halo_r)
ha = int((self._phase / 100) * 70)
halo.setColorAt(0.0, QColor(255, 209, 102, ha)) # or chaud
halo.setColorAt(0.30, QColor(155, 93, 229, ha // 2)) # violet
halo.setColorAt(0.60, QColor( 80, 20, 120, ha // 5)) # violet sombre
halo.setColorAt(1.0, QColor( 0, 0, 0, 0))
p.setBrush(QBrush(halo))
p.setPen(Qt.NoPen)
p.drawEllipse(int(cx - halo_r), int(cy_logo - halo_r),
int(halo_r * 2), int(halo_r * 2))
# Second halo — anneau violet pulsant
pulse = 0.85 + 0.15 * math.sin(self._tick_count * 0.055)
halo2_r = int(logo_size * 0.55 * pulse)
halo2 = QRadialGradient(cx, cy_logo, halo2_r)
ha2 = int((self._phase / 100) * 35)
halo2.setColorAt(0.0, QColor(155, 93, 229, 0))
halo2.setColorAt(0.75, QColor(155, 93, 229, ha2))
halo2.setColorAt(1.0, QColor(155, 93, 229, 0))
p.setBrush(QBrush(halo2))
p.drawEllipse(int(cx - halo2_r), int(cy_logo - halo2_r),
int(halo2_r * 2), int(halo2_r * 2))
# ── Logo ─────────────────────────────────────────
p.setOpacity(self._phase / 100.0)
if self._logo_pix and not self._logo_pix.isNull():
lw, lh2 = self._logo_pix.width(), self._logo_pix.height()
p.drawPixmap(cx - lw // 2, y_logo + (logo_size - lh2) // 2, self._logo_pix)
p.setOpacity(1.0)
# ── Titre ────────────────────────────────────────
if self._phase2 > 0:
fade = self._ease_out(self._phase2 / 100.0)
txt_alpha = int(fade * 255)
p.setFont(font_title)
if txt_alpha >= 2:
# Lueur violette large derrière
glow_v = int(txt_alpha * 0.18)
p.setPen(QColor(155, 93, 229, glow_v))
p.drawText(0, y_title + 3, W, title_h + 4, Qt.AlignHCenter, "ASTRALIS")
p.drawText(0, y_title - 1, W, title_h + 4, Qt.AlignHCenter, "ASTRALIS")
# Lueur dorée au-dessus
glow_g = int(txt_alpha * 0.28)
p.setPen(QColor(255, 209, 102, glow_g))
p.drawText(0, y_title + 1, W, title_h + 4, Qt.AlignHCenter, "ASTRALIS")
# Texte principal lilas-blanc
p.setPen(QColor(238, 232, 255, txt_alpha))
p.drawText(0, y_title, W, title_h + 4, Qt.AlignHCenter, "ASTRALIS")
# ── Ligne décorative — or → violet ───────────────
if self._phase2 > 5:
prog = self._ease_out(min(1.0, (self._phase2 - 5) / 35))
lhalf = int(title_w * 0.48 * prog)
la = int(prog * 160)
if lhalf > 2:
gl = QLinearGradient(cx - lhalf, 0, cx + lhalf, 0)
gl.setColorAt(0.0, QColor(155, 93, 229, 0))
gl.setColorAt(0.25, QColor(155, 93, 229, la // 2))
gl.setColorAt(0.50, QColor(255, 209, 102, la))
gl.setColorAt(0.75, QColor(155, 93, 229, la // 2))
gl.setColorAt(1.0, QColor(155, 93, 229, 0))
p.setBrush(QBrush(gl))
p.setPen(Qt.NoPen)
p.drawRect(cx - lhalf, y_line, lhalf * 2, 2)
# ── Sous-titre ────────────────────────────────────
if self._phase2 > 2:
sub_fade = self._ease_out(min(1.0, (self._phase2 - 2) / 40))
sub_alpha = int(sub_fade * 255)
p.setFont(font_sub)
p.setPen(QColor(138, 122, 170, sub_alpha))
p.drawText(0, y_sub, W, sub_h + 4,
Qt.AlignHCenter, "Moteur de simulation orbitale N-corps")
# ── Barre (progression réelle du dashboard) ─────
if self._load_progress > 0:
progress = self._load_progress / 100.0
bar_label = self._load_stage
elif self._phase2 > 40:
progress = min(0.12, self._phase2 / 100.0 * 0.12)
bar_label = "Lancement du tableau de bord..."
else:
progress = 0.0
bar_label = "Initialisation..."
bar_x = (W - bar_w) // 2
p.setBrush(QBrush(QColor(14, 12, 36, 140)))
p.setPen(Qt.NoPen)
p.drawRoundedRect(bar_x, y_bar, bar_w, bar_thick,
bar_thick // 2, bar_thick // 2)
fill = int(bar_w * progress)
if fill > 2:
gb = QLinearGradient(bar_x, 0, bar_x + fill, 0)
gb.setColorAt(0.0, QColor(155, 93, 229, 220))
gb.setColorAt(0.55, QColor(210, 160, 90, 240))
gb.setColorAt(1.0, QColor(255, 209, 102, 255))
p.setBrush(QBrush(gb))
p.drawRoundedRect(bar_x, y_bar, fill, bar_thick,
bar_thick // 2, bar_thick // 2)
tip = bar_x + fill
gw_r = bar_thick * 5.5
gw = QRadialGradient(tip, y_bar + bar_thick / 2, gw_r)
gw.setColorAt(0.0, QColor(255, 209, 102, 255))
gw.setColorAt(0.35, QColor(155, 93, 229, 140))
gw.setColorAt(0.7, QColor(196, 80, 160, 50))
gw.setColorAt(1.0, QColor(155, 93, 229, 0))
p.setBrush(QBrush(gw))
p.drawEllipse(int(tip - gw_r), int(y_bar + bar_thick / 2 - gw_r),
int(gw_r * 2), int(gw_r * 2))
p.setBrush(QBrush(QColor(238, 232, 255, 220)))
p.drawEllipse(int(tip - 2), int(y_bar + bar_thick / 2 - 2), 4, 4)
# Label barre
if progress > 0.01 or self._phase2 > 25:
la2 = int(min(1.0, max(progress, self._phase2 / 100.0)) * 160)
p.setFont(font_load)
p.setPen(QColor(255, 209, 102, la2))
pct_txt = f" — {int(self._load_progress)} %" if self._load_progress > 0 else ""
p.drawText(0, y_label, W, label_h + 4, Qt.AlignHCenter, bar_label + pct_txt)
# Hint clic
if self._phase2 > 30 and not self._anim_done:
ha2 = int(min(1.0, (self._phase2 - 30) / 40) * 70)
fh = QFont("Segoe UI", hint_sz, QFont.Light)
p.setFont(fh)
p.setPen(QColor(138, 122, 170, ha2))
p.drawText(0, y_hint, W, hint_sz * 2 + 4,
Qt.AlignHCenter, "Appuyer pour passer")
p.end()
# ── Main ──────────────────────────────────────────────────────────────────────
def main():
app = QApplication(sys.argv)
app.setWindowIcon(_build_icon())
win = SplashWindow()
sys.exit(app.exec_())
if __name__ == '__main__':
main()