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
Easier method for documenting and setting gestures for global plugin scripts #6266
Comments
CC @jcsteh, @camlorn, @derekriemer, @nvdaes |
In general, I like this idea. A few comments:
|
I'm wondering if this can cover the assignment of sequential gestures 2016-08-16 2:55 GMT+02:00, James Teh notifications@github.com:
|
I think it should also work on plane old functions. I think that you can detect the difference with isinstance. As I discussed on IRC we should really move toward some sort of simpler, class-free, single-file script API. Unfortunately, I'd be willing to bet this needs some sort of changes in core to work. |
There are very good reasons I don't think a non-OO model is going to
work for us. However, that is off topic for this issue. Let's not scope
bloat.
|
This is a different issue: #3687. Note that if that gets implemented, this should just work for the decorator being discussed here too (or at least it should be fairly easy to tweak).
Definitely. if we go with the |
Currently categories appear to be set on the class level, So if you were On 8/17/2016 4:26 PM, James Teh wrote:
|
There are two levels of category: class and method. For a method, there
is a .category attribute. See globalCommands for an example of where
this is used. The class category is used as the default if a method
doesn't explicitly specify a category.
|
Woof. I just grepped for scriptCategory assuming it would be the same On 8/17/2016 4:33 PM, James Teh wrote:
|
Thanks. 2016-08-18 0:26 GMT+02:00, James Teh notifications@github.com:
|
…andler module added a metaclass for collecting gestures on ScriptableObjects, this now supports getting from .gesture and .gestures set on script_ functions by the @script decorator. Fixes nvaccess#6266
…ta (#8236) * added an @script decorator for setting script metadata to the scriptHandler module added a metaclass for collecting gestures on ScriptableObjects, this now supports getting from .gesture and .gestures set on script_ functions by the @script decorator. Fixes #6266 * Removed gesture attribute from script functions Now passing gesture to the ```@script``` decorator will append the gesture to the list of gestures, rather than setting both gesture and gestures attributes on the function. * Removed unused getScripts method from BaseObject * Address review comment and rename GestureCollector to ScriptableType * Make the script decorator gestures work both for normal and dynamic NVDAObjects. Provide a working example for Excel * First baceObject tests * Fix decorated scripts not properly being added when subclassing objects * Finish unit tests * Add bypasInputHelp and resumeSayAllMode to the script decorator * Review actions * Add unit tests for the script decorator itself * Update developer guide * Review actions * Review actions regarding devGuide and comments * Only use the per class __gestures dictionary, also for decorated scripts * Last review action * Revert NVDAObjects/__init__.py to master, as in the end, this hasn't been touched by this change * Also revert changes to test suite objectProvider * Split of lines in devGuide * Rename the scripts in test_baseObject to follow the phonetic alphabet, to fix a bug in baseObject that used only the first character of a script name. * Log warnings when using the script decorator in a wrong way, either by decorating a non method or a method which name doesn't start with script_
I propose and will implement the following:
The text was updated successfully, but these errors were encountered: