Commit 78aff6c0 authored by Mark Hymers's avatar Mark Hymers

Fix iohub fix

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent d12aa3cc
......@@ -4,25 +4,29 @@ Subject: Fix iohub paths
Signed-off-by: Mark Hymers <mark.hymers@ynic.york.ac.uk>
---
psychopy/iohub/client/__init__.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
psychopy/iohub/client/__init__.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/psychopy/iohub/client/__init__.py b/psychopy/iohub/client/__init__.py
index 3474dc9..9e616a7 100644
index 3474dc9..9ec186d 100644
--- a/psychopy/iohub/client/__init__.py
+++ b/psychopy/iohub/client/__init__.py
@@ -850,11 +850,10 @@ class ioHubConnection(object):
@@ -850,11 +850,13 @@ class ioHubConnection(object):
experiment_info = None
session_info = None
hub_defaults_config = {}
- rootScriptPath = os.path.dirname(sys.argv[0])
- if len(rootScriptPath)<=1:
- rootScriptPath = os.path.abspath(".")
- # >>>>> Load / Create / Update iohub config file.....
- cfpath = os.path.join(IOHUB_DIRECTORY, 'default_config.yaml')
+ from pathlib import Path
+ rootScriptPath = os.path.join(str(Path.home()), '.config', 'iohub')
# >>>>> Load / Create / Update iohub config file.....
- cfpath = os.path.join(IOHUB_DIRECTORY, 'default_config.yaml')
+ os.path.makedirs(rootScriptPath, exist_ok=True)
+ # Allow user to have local config file
+ cfpath = os.path.join(rootScriptPath, 'default_config.yaml')
+ if not os.path.exists(cfpath):
+ cfpath = os.path.join(IOHUB_DIRECTORY, 'default_config.yaml')
with open(cfpath, 'r') as config_file:
hub_defaults_config = yload(config_file, Loader=yLoader)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment