ephys-link 2.0.0__py3-none-any.whl → 2.0.0b2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ephys_link/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.0.0"
1
+ __version__ = "2.0.0b2"
ephys_link/__main__.py CHANGED
@@ -1,51 +1,43 @@
1
- """Ephys Link entry point.
2
-
3
- Responsible for gathering launch options, instantiating the appropriate interface, and starting the application.
4
-
5
- Usage:
6
- ```python
7
- main()
8
- ```
9
- """
10
-
11
- from asyncio import run
12
- from sys import argv
13
-
14
- from keyboard import add_hotkey
15
-
16
- from ephys_link.back_end.platform_handler import PlatformHandler
17
- from ephys_link.back_end.server import Server
18
- from ephys_link.front_end.cli import CLI
19
- from ephys_link.front_end.gui import GUI
20
- from ephys_link.utils.console import Console
21
- from ephys_link.utils.startup import check_for_updates, preamble
22
-
23
-
24
- def main() -> None:
25
- """Ephys Link entry point."""
26
-
27
- # 0. Print the startup preamble.
28
- preamble()
29
-
30
- # 1. Get options via CLI or GUI (if no CLI options are provided).
31
- options = CLI().parse_args() if len(argv) > 1 else GUI().get_options()
32
-
33
- # 2. Instantiate the Console and make it globally accessible.
34
- console = Console(enable_debug=options.debug)
35
-
36
- # 3. Check for updates if not disabled.
37
- if not options.ignore_updates:
38
- check_for_updates(console)
39
-
40
- # 4. Instantiate the Platform Handler with the appropriate platform bindings.
41
- platform_handler = PlatformHandler(options, console)
42
-
43
- # 5. Add hotkeys for emergency stop.
44
- _ = add_hotkey("ctrl+alt+shift+q", lambda: run(platform_handler.emergency_stop()))
45
-
46
- # 6. Start the server.
47
- Server(options, platform_handler, console).launch()
48
-
49
-
50
- if __name__ == "__main__":
51
- main()
1
+ """Ephys Link entry point.
2
+
3
+ Responsible for gathering launch options, instantiating the appropriate interface, and starting the application.
4
+
5
+ Usage: call main() to start.
6
+ """
7
+
8
+ from sys import argv
9
+
10
+ from ephys_link.back_end.platform_handler import PlatformHandler
11
+ from ephys_link.back_end.server import Server
12
+ from ephys_link.front_end.cli import CLI
13
+ from ephys_link.front_end.gui import GUI
14
+ from ephys_link.util.console import Console
15
+
16
+
17
+ def main() -> None:
18
+ """Ephys Link entry point.
19
+
20
+ 1. Get options via CLI or GUI.
21
+ 2. Instantiate the Console and make it globally accessible.
22
+ 3. Instantiate the Platform Handler with the appropriate platform bindings.
23
+ 4. Instantiate the Emergency Stop service.
24
+ 5. Start the server.
25
+ """
26
+
27
+ # 1. Get options via CLI or GUI (if no CLI options are provided).
28
+ options = CLI().parse_args() if len(argv) > 1 else GUI().get_options()
29
+
30
+ # 2. Instantiate the Console and make it globally accessible.
31
+ console = Console(enable_debug=options.debug)
32
+
33
+ # 3. Instantiate the Platform Handler with the appropriate platform bindings.
34
+ platform_handler = PlatformHandler(options.type, console)
35
+
36
+ # 4. Instantiate the Emergency Stop service.
37
+
38
+ # 5. Start the server.
39
+ Server(options, platform_handler, console).launch()
40
+
41
+
42
+ if __name__ == "__main__":
43
+ main()