Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update query records and request to download api #204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tungntEmotiv
Copy link
Contributor

The PR include:

  • to add query_records.py example to demo how to use queryRecords, requestToDownloadRecordData, and exportRecord api.
  • fix issue directory of certificate file

Please help to review. Thanks

@@ -105,7 +111,11 @@ def open(self):

# As default, a Emotiv self-signed certificate is required.
# If you don't want to use the certificate, please replace by the below line by sslopt={"cert_reqs": ssl.CERT_NONE}
sslopt = {'ca_certs': "../certificates/rootCA.pem", "cert_reqs": ssl.CERT_REQUIRED}

file_dir_path = os.path.dirname(os.path.realpath(__file__))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use high level package to handle file path
https://docs.python.org/3/library/pathlib.html

@@ -92,6 +96,8 @@ def __init__(self, client_id, client_secret, debug_mode=False, **kwargs):
self.debit == value
elif key == 'headset_id':
self.headset_id = value
elif key == 'auto_create_session':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should tell about optional params in readme file..

@@ -272,6 +285,14 @@ def handle_result(self, recv_dic):
self.emit('mc_brainmap_done', data=result_dic)
elif req_id == SENSITIVITY_REQUEST_ID:
self.emit('mc_action_sensitivity_done', data=result_dic)
elif req_id == QUERY_RECORDS_ID:
Copy link
Contributor

@nguoithichkhampha nguoithichkhampha Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't use switch case. it's more readable then a lot of if-else.
you can write
match req_id: case QUERY_RECORDS_ID:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants