dalanicolai / gnome-tracker-extension

Ulauncher extension for (deep) search filesystem via the gnome tracker, recoll, docfetcher, locate or calibre index
63 stars 4 forks source link

Extension is not ready for Ulauncher 5.3.0 beta #7

Closed LinuxOnTheDesktop closed 5 years ago

LinuxOnTheDesktop commented 5 years ago

Ulauncher shows this error:

There's an error in manifest.json: 'required_api_version' is not provided

Ulauncher 5.3.0~beta1. Admittedly, I notice that we have the word 'beta' here . .

Linux Mint 19.1 Cinnamon

protostork commented 5 years ago

Hi @LinuxOnTheDesktop, I have been wondering about this too but I haven't been able to install the 5.x beta of ULauncher yet to check it.

As far as I can tell, the main difference between versions 4 and 5 is that 5 is written in Python3, as is this extension. Migration should be fairly easy, will try to have a look some time (or feel free to give it a go, if you feel like): http://docs.ulauncher.io/en/latest/extensions/migration.html

Has it let you install the extension (or was it preinstalled from the previous version) or does it throw up the error when you try to install it already?

If it is installed already in your 5.x ULauncher, maybe try typing this in the terminal:

cd ~/.cache/ulauncher_cache/extensions/com.github.dalanicolai.gnome-tracker-extension gedit versions.json

Then paste the below, save the file, and restart ulauncher to see if it works.

[
  { "required_api_version": "^1.0.0", "commit": "master" },
  { "required_api_version": "^2.0.0", "commit": "master" }
]

Again, I have no idea if that will work - but worth a try... It may need some more tweaks though (see the above link for details). Please let us know if it works ok and we can update the extension.

LinuxOnTheDesktop commented 5 years ago

Thanks!

The extension was preinstalled from the older version.

Creating that text file with the content you suggested did not work: the extension still showed in Ulauncher's options as broken; and typing lc in the Ulauncher search box continued to do essentially nothing.

Performing, in addition, steps 1-3 on the page you linked yielded this error in Ulauncher's settings:

The extension exited instantly. Please check the logs.

Performing, additionally, step 5 on that page did not change that error message. It did produce this output:

 ~/.cache/ulauncher_cache/extensions/com.github.dalanicolai.gnome-tracker-extension  $  2to3-3.5 *.py
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: buffer
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: idioms
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: set_literal
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: ws_comma
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Refactored appchooser.py
--- appchooser.py   (original)
+++ appchooser.py   (refactored)
@@ -21,7 +21,7 @@
         self.connect("key-press-event", self.on_key_press)

     def on_key_press(self, window, event):
-        print(event.keyval)
+        print((event.keyval))
         if event.keyval == Gdk.KEY_Escape:
             Gtk.main_quit()

RefactoringTool: Refactored main.py
--- main.py (original)
+++ main.py (refactored)
@@ -15,12 +15,12 @@
 from ulauncher.api.shared.action.RunScriptAction import RunScriptAction

 home = os.getenv("HOME")
-os.chmod(home+'/.cache/ulauncher_cache/extensions/com.github.dalanicolai.gnome-tracker-extension/appchooser.py', 0755) 
+os.chmod(home+'/.cache/ulauncher_cache/extensions/com.github.dalanicolai.gnome-tracker-extension/appchooser.py', 0o755) 

 def chunks(l, n):
     """Yield successive n-sized chunks from l."""
-    for i in xrange(0, len(l), n):
+    for i in range(0, len(l), n):
         yield l[i:i + n]

 def icon_path(*args):
RefactoringTool: Refactored search.py
--- search.py   (original)
+++ search.py   (refactored)
@@ -32,9 +32,9 @@
    try:
        result_docs = search(query, 28834)
        for doc in result_docs:
-           print(doc.getFilename() + "\t" + doc.getPathStr())
+           print((doc.getFilename() + "\t" + doc.getPathStr()))
    except:
-       print("ERROR: " + str(sys.exc_info()[1]))
+       print(("ERROR: " + str(sys.exc_info()[1])))

 # string, int -> [ResultDocument]
 def search(query, port):
RefactoringTool: Files that need to be modified:
RefactoringTool: appchooser.py
RefactoringTool: main.py
RefactoringTool: search.py

Running the same command in the py4j subfolder produced a load of output but did not help either.

protostork commented 5 years ago

Thanks @LinuxOnTheDesktop for the super-helpful troubleshooting, debugging and error messages! I've updated the extension to be compatible with ULauncher 5.0 which seems to work for me.

Please go to the extension preferences and click on 'check update' in the top right, it should pull the new version from github directly. If that doesn't work, try removing the extension from the preferences (then maybe kill and restart ulauncher), and try installing the extension again from fresh from github (your settings should be saved).

If you face any issues, please let us know.

protostork commented 5 years ago

Ok, have finally managed to get ulauncher 4 working again - I think I needed to clear the extensions cache directory before installing the old package. The extension now installs smoothly on UL 4 and 5 and works normally, all good :)

LinuxOnTheDesktop commented 5 years ago

@desigit

After updating in the way you described, initially the extension did not work but then - after, I think, clicking 'reload list' on the extension page - it does; and now all seems to work. Very good!

protostork commented 5 years ago

Cool, thanks for your help!

dalanicolai commented 5 years ago

@desigit Sorry I was not on github for a few days. Anyway, I see you fixed it again. So thanks again. I will stop thanking you explicitly from now on. But you can be sure I really appreciate your work and maintenance. Anyway, so even if I keep quiet you can be sure I will follow what happens and enjoy what you are doing. Also @LinuxOnTheDesktop of course thanks for reporting and help debugging these issues.