Permalink
Browse files

BF: A few small fixes for the iohub datastore

It's still not working, but we're slowly getting closer.
  • Loading branch information...
hoechenberger committed Jan 31, 2019
1 parent 5e652fb commit e6a2169d62d39f0683990fe6b364568b4b17ac2f
@@ -1130,7 +1130,7 @@ def _sendToHubServer(self, tx_data):
raise ioHubError(result)

# Otherwise return the result
if constants.PY3 and not result is None:
if constants.PY3 and result is not None:
if isinstance(result, list):
for ind, items in enumerate(result):
if isinstance(items, list) and not items is None:
@@ -102,21 +102,11 @@ def buildOutTemplate(self):
self.emrtFile.SCHEMA_MODIFIED = SCHEMA_MODIFIED_DATE

#CREATE GROUPS
froot = self.emrtFile.root
ttitle = 'ioHub DeviceEvent Class to DataStore Table Mappings.'
self.TABLES['CLASS_TABLE_MAPPINGS'] = self.emrtFile.createTable(froot,
'class_table_mapping',
ClassTableMappings,
title=ttitle)

#getattr(self.emrtFile, create_group)(self.emrtFile.root, 'analysis', title='Data Analysis Files, notebooks, scripts and saved results tables.')

self.TABLES['CLASS_TABLE_MAPPINGS'] = getattr(self.emrtFile, create_table)(
self.emrtFile.root,
'class_table_mapping',
ClassTableMappings,
title='Mapping of ioHub DeviceEvent Classes to ioHub DataStore Tables.'
)
title='ioHub DeviceEvent Class to DataStore Table Mappings.')

getattr(self.emrtFile, create_group)(
self.emrtFile.root,
@@ -199,7 +189,7 @@ def updateDataStoreStructure(self, device_instance, event_class_dict):
event_table_label = event_cls.IOHUB_DATA_TABLE
if event_table_label not in self.TABLES:
try:
self.TABLES[event_table_label] = self.emrtFile.createTable(
self.TABLES[event_table_label] = getattr(self.emrtFile, create_table)(
self.groupNodeForEvent(event_cls),
self.eventTableLabel2ClassName(event_table_label),
event_cls.NUMPY_DTYPE,
@@ -3,6 +3,7 @@
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).

from past.types import basestring
import numpy as N
from .. import Device, DeviceEvent, Computer, Device
from ...constants import DeviceConstants, EventConstants
@@ -21,6 +21,7 @@
pass

from past.builtins import basestring, unicode
from psychopy.constants import PY3
from . import _pkgroot
from . import IOHUB_DIRECTORY, EXP_SCRIPT_DIRECTORY, _DATA_STORE_AVAILABLE
from .errors import print2err, printExceptionDetailsToStdErr, ioHubError
@@ -376,6 +377,9 @@ def unregisterWindowHandles(self, *win_hwhds):
self.iohub._pyglet_window_hnds.remove(wh)

def createExperimentSessionEntry(self, sessionInfoDict):
if PY3:
sessionInfoDict = {str(k, 'utf-8'): str(v, 'utf-8')
for k, v in sessionInfoDict.items()}
self.iohub.sessionInfoDict = sessionInfoDict
dsfile = self.iohub.dsfile
if dsfile:

0 comments on commit e6a2169

Please sign in to comment.