-
Notifications
You must be signed in to change notification settings - Fork 184
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 extractDoc.py, gtk autocomplete #841
Conversation
@josephj11 or @Elliria (or anyone else that reads this) Can y'all install this and test the autocomplete for a bit before we merge it in? |
Sure, but first, what does it do? I'm not clear on what's being auto-completed or what would need to be done to test if it's doing what it ought to do. |
Try to write a script in the gtk/qt interface and find out :)
It's setup to show the API methods once you hit the `.` character of an API
call so;
```
keyboard.
engine.
clipboard.
```
Should display a pop-up of the available API methods for that module
…On Sat, Apr 22, 2023, 11:24 Elliria ***@***.***> wrote:
Sure, but first, what does it do? I'm not clear on what's being
auto-completed or what would need to be done to test if it's doing what it
ought to do.
—
Reply to this email directly, view it on GitHub
<#841 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANA2OBWTGYPCETPIU5IIFDXCPZ2RANCNFSM6AAAAAAXANOYGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Oh, how nice! |
Okay, I've cloned it with this command:
Now, how do I run it without installing it? It looks like our Zero-installation Method instructions are outdated and will need an update. |
That method should work, I use it every day.
You have to quit out of other AutoKey instances prior
…On Sat, Apr 22, 2023, 13:04 Elliria ***@***.***> wrote:
Okay, I've cloned it with this command:
git clone --branch develop-autocomplete --single-branch https://github.com/autokey/autokey.git
Now, how do I run it without installing it? It looks like our Zero-installation
Method
<https://github.com/autokey/autokey/wiki/Installing#zero-installation-method>
instructions are outdated and will need an update.
—
Reply to this email directly, view it on GitHub
<#841 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANA2ODKCSZHLAI77CJPSKTXCQFQ7ANCNFSM6AAAAAAXANOYGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There are no prior instances of AutoKey and it's not even installed in this VM. Here's what happens when I follow those steps in an up-to-date copy of Kubuntu 22.04 LTS: elliria@elliria-VirtualBox:~/Desktop/autokey$ cd lib
elliria@elliria-VirtualBox:~/Desktop/autokey/lib$ python3 -m autokey.gtkui
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/elliria/Desktop/autokey/lib/autokey/gtkui/__main__.py", line 4, in <module>
from autokey.gtkapp import Application
File "/home/elliria/Desktop/autokey/lib/autokey/gtkapp.py", line 35, in <module>
from autokey.autokey_app import AutokeyApplication
File "/home/elliria/Desktop/autokey/lib/autokey/autokey_app.py", line 32, in <module>
from autokey import service, monitor
File "/home/elliria/Desktop/autokey/lib/autokey/service.py", line 33, in <module>
from autokey.iomediator.iomediator import IoMediator
File "/home/elliria/Desktop/autokey/lib/autokey/iomediator/iomediator.py", line 24, in <module>
from autokey.interface import XRecordInterface, AtSpiInterface
File "/home/elliria/Desktop/autokey/lib/autokey/interface.py", line 41, in <module>
import Xlib.threaded as xlib_threaded
ModuleNotFoundError: No module named 'Xlib'
elliria@elliria-VirtualBox:~/Desktop/autokey/lib$ python3 -m autokey.qtui
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/elliria/Desktop/autokey/lib/autokey/qtui/__main__.py", line 23, in <module>
from autokey.qtapp import Application
File "/home/elliria/Desktop/autokey/lib/autokey/qtapp.py", line 33, in <module>
from autokey.autokey_app import AutokeyApplication
File "/home/elliria/Desktop/autokey/lib/autokey/autokey_app.py", line 32, in <module>
from autokey import service, monitor
File "/home/elliria/Desktop/autokey/lib/autokey/service.py", line 33, in <module>
from autokey.iomediator.iomediator import IoMediator
File "/home/elliria/Desktop/autokey/lib/autokey/iomediator/iomediator.py", line 24, in <module>
from autokey.interface import XRecordInterface, AtSpiInterface
File "/home/elliria/Desktop/autokey/lib/autokey/interface.py", line 41, in <module>
import Xlib.threaded as xlib_threaded
ModuleNotFoundError: No module named 'Xlib'
elliria@elliria-VirtualBox:~/Desktop/autokey/lib$ |
Ah well yeah that would explain it.
It's on my list of things to do.
You can just install AutoKey normally via apt-get and then do the zero
installation method
…On Sat, Apr 22, 2023, 13:40 Elliria ***@***.***> wrote:
There are no prior instances of AutoKey and it's not even installed in
this VM. Here's what happens when I follow those steps:
***@***.***:~/Desktop/autokey$ cd lib
***@***.***:~/Desktop/autokey/lib$ python3 -m autokey.gtkui
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/elliria/Desktop/autokey/lib/autokey/gtkui/__main__.py", line 4, in <module>
from autokey.gtkapp import Application
File "/home/elliria/Desktop/autokey/lib/autokey/gtkapp.py", line 35, in <module>
from autokey.autokey_app import AutokeyApplication
File "/home/elliria/Desktop/autokey/lib/autokey/autokey_app.py", line 32, in <module>
from autokey import service, monitor
File "/home/elliria/Desktop/autokey/lib/autokey/service.py", line 33, in <module>
from autokey.iomediator.iomediator import IoMediator
File "/home/elliria/Desktop/autokey/lib/autokey/iomediator/iomediator.py", line 24, in <module>
from autokey.interface import XRecordInterface, AtSpiInterface
File "/home/elliria/Desktop/autokey/lib/autokey/interface.py", line 41, in <module>
import Xlib.threaded as xlib_threaded
ModuleNotFoundError: No module named 'Xlib'
***@***.***:~/Desktop/autokey/lib$ python3 -m autokey.qtui
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/elliria/Desktop/autokey/lib/autokey/qtui/__main__.py", line 23, in <module>
from autokey.qtapp import Application
File "/home/elliria/Desktop/autokey/lib/autokey/qtapp.py", line 33, in <module>
from autokey.autokey_app import AutokeyApplication
File "/home/elliria/Desktop/autokey/lib/autokey/autokey_app.py", line 32, in <module>
from autokey import service, monitor
File "/home/elliria/Desktop/autokey/lib/autokey/service.py", line 33, in <module>
from autokey.iomediator.iomediator import IoMediator
File "/home/elliria/Desktop/autokey/lib/autokey/iomediator/iomediator.py", line 24, in <module>
from autokey.interface import XRecordInterface, AtSpiInterface
File "/home/elliria/Desktop/autokey/lib/autokey/interface.py", line 41, in <module>
import Xlib.threaded as xlib_threaded
ModuleNotFoundError: No module named 'Xlib'
***@***.***:~/Desktop/autokey/lib$
—
Reply to this email directly, view it on GitHub
<#841 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANA2OA5OFZ7O2I7EOZR3DLXCQJYFANCNFSM6AAAAAAXANOYGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Install the one from the Ubuntu repository normally and then do the Zero-installation method inside of the cloned directory? |
Yes
…On Sat, Apr 22, 2023, 13:44 Elliria ***@***.***> wrote:
Install the one from the Ubuntu repository normally and then do the
Zero-installation method inside of the cloned directory?
—
Reply to this email directly, view it on GitHub
<#841 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANA2OFLQXSJ62WJ3QHSUKDXCQKGTANCNFSM6AAAAAAXANOYGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That worked! It's very cool. Is there any way to have it auto-detect that you're inside of a comment and have it not fire? For example, this should not trigger the menu: # Blah blah blah keyboard. Neither should this:
Nor should this:
|
Also, can the drop-down offerings be sorted alphabetically? It's very cool. I can see how this would save a lot of time and effort, especially if you're writing a script with a lot of API calls in it. |
I might update it so that it doesn't autocomplete when on a line after a It's mostly there to give you a quick reference on what methods are available. yeah, idk what the deal with the 3.10 test was, I cancelled it, not sure why it was looping, can't imagine how this type of change would have impacted the tests, I don't think there's any coverage for anything that I touched here |
Yeah, I think the test is a problem at GitHub's end. I had one that cancelled after a while the other day. They may be doing work on those. |
Okay, disabling it in lines that start with # would be wonderful. The other two are used less frequently, anyway. Also, I noticed that you can press something like an arrow key to turn off the drop-down menu if you don't want to use it. I'd still like it not to show up on the hash-mark lines, though, because I comment the heck out of my code and am likely to trigger it. |
This is absolutely awesome, @sebastiansam55. I have a feeling @josephj11 is going to love it, too. |
Are you planning on doing the store API call, too? |
sort by func_name
…okey into develop-autocomplete
@Elliria I actually forgot about those functions, I've added them in, you should be able to |
Okay, I'll do that. I'm running out of time, though. This is New York and we're about to get hammered by storms. By the way, I've updated the Running Tests wiki page by adding the Trying out a clone of AutoKey section so that anyone who'd like to help out the developers by trying out their code can do so without having to install it. As always, feedback is welcome, as are edits. Please ignore the outdated Running unit tests section on that page. That will be taken care of once we've got something solid to replace it with. |
@sebastiansam55 Could you give us a hand on how rebasing and merging works so we do it the right way? You seem to have it down. |
I have used autocomplete a bit in AutoKey before. It seems to work - at least in the Qt version. I primarily use the Qt version, but I will try to test your new changes in the GTK version. The main problem I have is that (especially in Qt) the editing panel theme is almost unusable in Breese dark. Most text is almost invisible and the cursor is completely invisible - so I do almost all my editing in kate where I can see what I'm doing. I tried the GTK version a while ago. It had the same problems. I was able to select a different theme (using the option that was added to the GTK version) and that helped a lot. I don't remember if the cursor was fixed as well. |
Thank you for adding the store functions and for alphabetizing the entries in the auto-complete menu. That's perfect. I tested both the GTK and Qt auto-complete behaviors and noticed a difference between them:
In each test, I saw some X protocol errors that had something to do with Xlib.error.BadAccess. Those may or may not be related to the auto-complete code, but I thought I'd mention them as a possible matter of interest. Below are the steps I took, the logs from each session, a couple of animated GIFs, a screenshot, and a final follow-up with some odd behavior after getting rid of the clone directory. SHOW THE TESTSGTK test:
Qt test:
Qt test again a bit differently:
Odd behavior after deleting the cloneLast, but not least, I manually deleted the clone's directory when I was finished with the tests. I then ran AutoKey from the KDE menu, which should have run the standard installation of AutoKey 0.95.10 that I had installed from the Ubuntu repositories before grabbing the clone. When I launched the GTK front-end and tried to trigger the auto-complete menu, it wouldn't trigger, so I reassured myself that I was running the correct version of AutoKey. When I ran the Qt front-end of AutoKey, however, and tried to trigger the auto-complete menu, it triggered. This means the cloned Qt front-end is still running even though I deleted the directory. I did the |
With Autokey 0.96 it updates config files in a way that breaks backwards compatibly iirc, related to the sidecar file changes. and yeah, the Qt/GTK autocomplete behavior is not going to be exactly the same, they use different underlying systems for the auto complete. @josephj11 re: git, I know enough to be dangerous and that's it. I'm very much a self taught programmer, and to that end, the best way to figure things out is to do them, you should make a fork of autokey and then open a PR on your for for master>develop and see what issues arise and learn about it. |
That was a terrific line. I'll second it. |
Well done, @sebastiansam55. It's a wonderful new feature. |
Updates
extractDoc.py
, this will now generate the qtapi.txt
and two files for gtk autocompletion,api.csv
andmacro.csv
.Adds autocompletion to Gtk for both the phrase and script pages.
At this time I don't see any easy way to add autocompletion to the Qt phrase pages.