Search text in your scripts via help of popup menu
-
Little (not quick but still dirty) script to be executed once by Pythonista restart (fi in your pythonista_startup.py).
When you tap help in the popup menu of a selected text
After some seconds (function of your iDevice, the number and size of your scripts), you get a list of scripts containing the selected text (case insensitive)
If you select a script, you'll get, like for Pythonista help, a small (webview) window displaying the script as an html with Python syntax highlighting, where occurrences of selected text are also highlighted (in yellow)
If you search has also results in Pythonista help, you'll see both results in the list
The script imports @jonB's swizzle module
You can find this script here
-
@cvp, wow! Now we know what you have been doing.
Sort of acts like a help as well, right?
-
OUTSTANDING!
i have been missing the abilitynto lookup my own code like this from my pc IDE's i used to use for .net Thanks!
-
@mikael said:
Sort of acts like a help as well, right?
Yes and no.
It is used like an help but it does not give any help, it is only a way to scan your sources to find a text. Not sure this code would be used so. Perhaps it could be easier to have the search as a Pythonista tool. But, I've had some fun at least 😀
-
garenteed EVERYDAY use from this guy lol
-
@cvp got a
NameError
when searching a local method variable by accedent
screen shotEDIT:
Well after another app restart itbstarted working again. not sure what happened .
-
@stephen yes, bug....
def setSearchResults_(_self,_sel,_search_results): from objc_util import ObjCInstance, ns
Import * not allowed... ns forgotten
Import in def needed because script executed once but defs can be called later and import of module no more in memoryGitHub corrected
-
@cvp awesome ty! this module has already helped alot
-
@stephen Thanks but I'd not be astonished if you meet other bug(sss) 😢
-
@cvp heads up sems like GitHub update did not take
Eh bugs happen. tells you it is doing somthing 😉
-
A best idea would be to add a new menu option in the popup menu for searching in sources, without doing that in the help menu.
But I don't know how to do that.
Perhaps @jonB who already did that in the past but also said that it was only for one edited tab.
-
last edited by
-
@cvp appollagize 😅 looked at wrong line. been a day..
-
@cvp Interesting! Thanks for sharing!
-
@cvp. Helpful! Thank you.