-
Notifications
You must be signed in to change notification settings - Fork 119
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
Implements tomlkit in place of toml dependency #372
Implements tomlkit in place of toml dependency #372
Conversation
|
Oh my goodness. Not a problem. Yep that's probably the issue small typo on my part. |
Error loading _caster from "C:\NatLink\NatLink\MacroSystem\_caster.py"
Traceback (most recent call last):
File "C:\NatLink\NatLink\MacroSystem\core\natlinkmain.py", line 331, in loadFile
imp.load_module(modName,fndFile,fndName,fndDesc)
File "C:\NatLink\NatLink\MacroSystem\_caster.py", line 168, in <module>
_NEXUS.merger.merge(MergeInf.BOOT)
File "C:\NatLink\NatLink\MacroSystem\caster\lib\dfplus\merge\ccrmerger.py", line 352, in merge
self._add_grammar(base, True, negation_context)
File "C:\NatLink\NatLink\MacroSystem\caster\lib\dfplus\merge\ccrmerger.py", line 215, in _add_grammar
repeater = self._create_repeat_rule(rule)
File "C:\NatLink\NatLink\MacroSystem\caster\lib\dfplus\merge\ccrmerger.py", line 402, in _create_repeat_rule
sequence = Repetition(single_action, min=1, max=max, name=SEQ)
File "C:\Python27\lib\site-packages\dragonfly\grammar\elements_basic.py", line 555, in __init__
assert max is None or isinstance(max, int)
AssertionError So a bit of debugging on this aspect. It appears that there's differences between tomlkit api and json/toml read keys. "caster\lib\dfplus\merge\ccrmerger.py", line 401 |
It appears that tomlkit has special types for (String, Integer, Float, Bool, etc.) hence the differences between <class 'tomlkit.items.Integer'> vs expected <type 'int'>. unlike the previous toml Implementation. That being said I think that tomlkit maybe only for editing and creating toml documentation not |
aebc8be
to
e5da01c
Compare
e5da01c
to
ee13a5e
Compare
ee13a5e
to
efbaff9
Compare
@LexiconCode Where did you get that exception? I am trying to just change the import and have not noticed any problems yet. Could you please, eventually, try version 0.5.5? |
(I am revisiting this because I am realizing English also suffers from incorrect toml saving, albeit just slightly, with loanwords) |
That's great news, I'll look into it soon. As for the exception it was triggered simply after changing all the imports. It was a while back so I don't remember the specifics. |
I'll be looking into this issue next! |
@comodoro I've created a branch with the changes. The following error happens during startup.
|
Function to convert everything to plain old python objects |
@comodoro With tomlkit if user directory is deleted then caster loads fine the first time. the 2nd load the assertion error appears. |
Oops, I had not actually changed it in settings, sorry. Your link actually solves it - the |
dictation-toolbox/dragonfly#125 ( |
@comodoro can you give an example of how the value method would be used in loading toml? |
Just using it on the loaded dictionary:
Only right now Dragonfly expects int where tomlkit returns long (the exception above). I hope there are no more problems, at least I have not encountered any. |
Alright thanks for that! Indeed does work. I will make a new pull request! |
A work in progress is not ready for testing.
Fixes non-ASCII characters in clipboard
#357
Implements sorting keys
#323