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

remove ujson as a dependency #30

Closed
isolver opened this issue Apr 13, 2013 · 1 comment
Closed

remove ujson as a dependency #30

isolver opened this issue Apr 13, 2013 · 1 comment
Assignees
Milestone

Comments

@isolver
Copy link
Owner

isolver commented Apr 13, 2013

Since msgpack is being used to encode and decode data sent between processes (it is as fast as ujson, but compresses the messages by about 50% the original size on average), then there is no real need to also use ujson.

ujson right now is being used in a couple places to encode and decode python dictionaries for storage in the datastore file because it is fast and the output is still human readable.

We can use msgpack for the same purpose, however the string output will no longer be human readable if viewed prior to using msgpack to decode it again. This is fine, the API just needs to do the decoding first, which it is already doing but with ujson.

isolver pushed a commit that referenced this issue Apr 14, 2013
#29: inprogress:

- ucode (the ord of the unichr) field added to keyboard event
- key field == utf-8 encoded unicode character pressed, or a character
label for common non visible keys.
- windows  seems OK as a first pass test. Linux has issues with modifier
mappings; OSX has some issues with modifiers and also mapping of some
ucodes. All platforms, 'run' at least. ;)
- modifiers are stored as the logical & of processed modifier keys. When
the experiment process receives new keyboard event s from the server,
when they are converted from their internal list format to the
namedtuple, the modifiers field is turned into a list of modifier labels
based on the stored logical & info.
- keyfield is stored in the evnt list format as a utf-8 encoded byte
string.  When the experiment process receives new keyboard event s from
the server, when they are converted from their internal list format to
the namedtuple, the key field is converted into a unicode string by
decoding the byte string using utf-8 encoding.

#28: implemented in all 3 OSs.
Made filtering of auto repeat events an option that can be set in the
config file for the keyboard device. Default is to filter repeated press
events generated by the OS. Setting that can be added to config file to
control this is called
" report_auto_repeat_press_events " and can be True or False.

#30: in progress. About half of ujson usage has been removed.

# 31: in progress. Have not switched to weak refernces yet, but have so
far added some exception handling at points in code that should have had
it so that the ioserver process does not stop processing UDP requests
but still process device inputs. This has improved how often the orphans
server process will occur when you purposefully cause an exception to
occur. It is not elliminated. Also, on OSX it seems that almost every
time the ioHub server is terminated, the client times out waiting for
the process to shutdown and has to force fill it instead. I think that
the carbon event hooks are not being shut down correctly. Will
investigate.
@ghost ghost assigned isolver Apr 14, 2013
@isolver
Copy link
Owner Author

isolver commented Apr 16, 2013

msgpack is now used for all encoding / decoding needs. This includes saving the few DataStore columns that hold python dictionaries.

This has resulting in DataStore files created with previous versions of the library not being readable. If that just anyone grief, let me know and I will spend the time to add conditional ujson loading and decoding of columns as needed (if when msg pack it used it throws an exception).

@isolver isolver closed this as completed Apr 16, 2013
isolver pushed a commit that referenced this issue Apr 16, 2013
Also added a DataStore reading example that is based on an example data
extraction script written for Pierce.
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

No branches or pull requests

1 participant