Skip to content

Commit 1625a4f

Browse files
committed
Updated main entry point
1 parent 4d2b59c commit 1625a4f

3 files changed

Lines changed: 394 additions & 345 deletions

File tree

erdetect/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import sys
33
from erdetect.utils.misc import CustomLoggingFormatter
44
from erdetect.version import __version__
5-
from erdetect import main_cli as __main__
65
from erdetect._erdetect import process
76
from erdetect.views.gui import open_gui
87
__all__ = ['process', 'open_gui', '__version__']

erdetect/__main__.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Evoked response detection - command-line entry-point
4+
=====================================================
5+
Command-line entry-point script for the automatic detection of evoked responses in CCEP data.
6+
7+
8+
Copyright 2022, Max van den Boom (Multimodal Neuroimaging Lab, Mayo Clinic, Rochester MN)
9+
10+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
11+
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
12+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
13+
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14+
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
"""
16+
import os
17+
import sys
18+
19+
# add a system path to ensure the absolute imports can be used
20+
if not __package__:
21+
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
22+
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
23+
if PACKAGE_DIR not in sys.path:
24+
sys.path.insert(0, PACKAGE_DIR)
25+
26+
#
27+
from erdetect.main_cli import execute
28+
if __name__ == "__main__":
29+
sys.exit(execute())
30+
31+
32+

0 commit comments

Comments
 (0)