• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

int-brain-lab / iblrig / 9032957364

10 May 2024 01:25PM UTC coverage: 48.538% (+1.7%) from 46.79%
9032957364

Pull #643

github

74d2ec
web-flow
Merge aebf2c9af into ec2d8e4fe
Pull Request #643: 8.19.0

377 of 1074 new or added lines in 38 files covered. (35.1%)

977 existing lines in 19 files now uncovered.

3253 of 6702 relevant lines covered (48.54%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.55
/iblrig/gui/splash.py
1
from PyQt5 import QtCore
2✔
2
from PyQt5.QtCore import QEasingCurve, QPoint, QPropertyAnimation, QThreadPool, QTimer
2✔
3
from PyQt5.QtWidgets import QDialog
2✔
4
from typing_extensions import override
2✔
5

6
from iblrig import __version__ as version
2✔
7
from iblrig.constants import COPYRIGHT_YEAR
2✔
8
from iblrig.gui.tools import Worker
2✔
9
from iblrig.gui.ui_splash import Ui_splash
2✔
10
from iblrig.hardware_validation import Result, get_all_validators
2✔
11
from iblrig.path_helper import load_pydantic_yaml
2✔
12
from iblrig.pydantic_definitions import HardwareSettings, RigSettings
2✔
13

14

15
class Splash(QDialog, Ui_splash):
2✔
16
    validation_results: list[Result] = []
2✔
17

18
    def __init__(self, *args, **kwargs):
2✔
NEW
19
        super().__init__(*args, **kwargs)
×
NEW
20
        self.setupUi(self)
×
NEW
21
        self.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.FramelessWindowHint)
×
NEW
22
        self.installEventFilter(self)
×
23

24
        # store arguments as members
NEW
25
        self.hardware_settings = load_pydantic_yaml(HardwareSettings)
×
NEW
26
        self.rig_settings = load_pydantic_yaml(RigSettings)
×
27

28
        # update a few strings
NEW
29
        self.labelVersion.setText(f'v{version}')
×
NEW
30
        self.labelCopyright.setText(f'© {COPYRIGHT_YEAR}, International Brain Laboratory')
×
31

32
        # extremely important animation
NEW
33
        self.hat.setProperty('pos', QPoint(0, -250))
×
NEW
34
        self.animation = QPropertyAnimation(self.hat, b'pos')
×
NEW
35
        self.animation.setEasingCurve(QEasingCurve.InQuad)
×
NEW
36
        self.animation.setEndValue(QPoint(0, 40))
×
NEW
37
        self.animation.setDuration(500)
×
NEW
38
        self.animation.start()
×
39

40
        # start timer for force close
NEW
41
        QTimer.singleShot(20000, self.stop_and_close)
×
42

43
        # start validation worker
NEW
44
        worker = Worker(self.validation)
×
NEW
45
        worker.signals.finished.connect(self.close)
×
NEW
46
        QThreadPool.globalInstance().tryStart(worker)
×
47

NEW
48
        self.show()
×
49

50
    def validation(self):
2✔
NEW
51
        for validator in get_all_validators():
×
NEW
52
            validator_instance = validator(hardware_settings=self.hardware_settings, iblrig_settings=self.rig_settings)
×
NEW
53
            self.labelStatus.setText(f'Validating {validator_instance.name} ...')
×
NEW
54
            for result in validator_instance.run():
×
NEW
55
                self.validation_results.append(result)
×
56

57
    def stop_and_close(self):
2✔
NEW
58
        self.close()
×
59

60
    @override
2✔
61
    def close(self):
2✔
NEW
62
        super().close()
×
63

64
    @override
2✔
65
    def eventFilter(self, obj, event):
2✔
66
        """Disregard all key-presses"""
NEW
67
        return obj is self and event.type() == QtCore.QEvent.KeyPress
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc