-
Notifications
You must be signed in to change notification settings - Fork 121
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
Caster as a Package: Master Thread #382
Comments
My 2c: I think that if the py files for CCR rules and apps are going to be taken out of user space then there need to be better and clearer ways of adding or modifying commands than are currently available, otherwise we are taking a lot of power out of the hands of users. As we've seen recently, almost the first thing most users, especially programmers, want to do when they get started is to see how the commands are defined and work out how they can add new ones and modify existing ones. At the moment it's as simple as opening a couple of .py files in locations which the user is aware of. It doesn't even need documentation because the code is self-explanatory. How is this going to work when all of the files are buried in the Python directory and vulnerable to being overridden during updates? While I think it's fine to take mechanism like CCRmerger and hide it away, in principle users should have complete control over policy. |
Those are some good thoughts, thank you. First I would like to try to restate the issues you've brought forth in my own words. That gives you a chance to verify and clarify my understanding.
|
This is a very valid concern. The issue with destroying customizations during updates was always a problem. The old |
So when were talking about starter rules were talking about applications and CCR. They would be copied over into the |
Is there a simple |
Place |
@LexiconCode I don't know if it actually needs to be a stopgap measure. If one of the starter rules gets updated and someone (A) is aware of the update and (B) wants it, they can just copy the file down from Github, right? Probably the "modify and never update" strategy is far more common than the people who've been doing commits and resolving merge conflicts. Thoughts? |
I agree with you both. The files should be copied over to the user directory if they are absent and the user should be nagged to death if there's a potential conflict with the changes. |
Hopefully we can improve the situation in the future. We should continue looking for a solution that doesn't edit source code but survives updates for user customizations. This would still help group A and B. However for now, we can move CCR and Apps into the user directory. This option should be able to be turned off in the user settings for those that are comfortable enough with filter rules. If we do move forward with this issue there may be things that change in the package that aren't updated in the CCR or applications that might break. I'm also curious about your work with python.toml |
@LexiconCode I think TOML may be at least a partial solution, 95% of what users do on a daily basis can be done with just Key and Text objects, which can easily be defined as strings in a config file. My Python rule looks like this: BINDINGS = utilities.load_toml_relative("config/python.toml")
And the toml file looks like this:
Alternating command just executes the first string as text, second as keys, etc. One of the major advantages of this is that it allows for basic addition/editing of commands without rebooting Dragon. Doing a Doing this for every rule would be a fairly major project though so it's probably something to think about for the long term. |
I have an alternative proposal. Although we can certainly do what is been mentioned previously depending in how we proceed. Although if you guys don't think the following proposal worth it, that's okay. Here my thoughts. Starting off with some Terminology. For every application and CCR file that's in the source code a corresponding template file would be generated upon start up if absent in the user space. The CCR would work the same way as the apps. I'll use the app folder as a example. Currently
Then in the user space
So what would be in these template files contained in Each file would be a template for two purposes.
new user command - 2A. Customized commands from source code: When users customize they altar the spec or the action. Not both otherwise it would be a new Command. So if we add a special class that compares the spec and action during to each source code command during merge.
original source code -
Customized Spec - -- or -- Customized Action - 2.B Another tack would be to utilize
If either a customized Spec or Action matches part of an existing command It will be overridden with the user's customization. As an edge case, If for some reason both action and rule are different is treated as a completely new command. How is this better than the current implementation and process for user customization?
@mrob95 While I think your solution is very neat but there are some things that need to be considered.
Ultimately I think reload ability needs to be addressed in Dragonfly and then Caster. That's just my perception and I'm totally open to whatever the consensus of our current users. |
@LexiconCode , that solution comes very close to reinventing Vocola. Reloadability is achievable without text files. Ultimately the text files should go away. In order to achieve better reloadability, we ought to be actually managing modules via As for the updates/customizations issue, this sidesteps it in the same way that copying all the full Python files does, except it adds the complexity of needing to know the template format. |
I think that just copying the files is a reasonable solution for now. It's probably not all that often that changes are made to the existing grammar definitions. Adding new App/CCR grammars will be fine, since the new files will just be created in the user's grammar directory. |
One other issue at hand to be discussed. Currently the PIP install doesn't include _caster.py. which makes sense. I was wondering if there was possibility to create a post install script that runs after PIP that would detect I could make the script and integrate it in to setup.py. Post-install script with Python setuptools thoughts? |
That said, if you put that in setup.py, will it run on every update? I think we only want to copy the files to the user directory once. |
Thinking on it more we could use It's a little bit more than a simple one time copy. We don't want to overwrite files in the user directory that already exist. In an update scenario where a new application or CCR is added. Those could be safely added in the user space as well. |
Yes, I agree with that design on all points:
And yes, I'd rather keep the starter rules setup out of setup.py. |
The last issue
Will be integrated in the the roadmap. Therefore this issue will close. |
This is an issue that will help track only various issues, pull requests and documentation related to the transition to a the Caster Voice pip package. #374 implemented caster as a PIP package. Once we are comfortable with the pull request to this issue will be closed.
Each issue or sub issue will have boxes to indicate whether their Status.
Legend
Issues
✔️ Invalid links due to directory name change #379 Readme links are broken in the development branch.
Issues with configdebug.txt
Issues with PIP castervoice package
Bugs related to transition
Other
The text was updated successfully, but these errors were encountered: