Giter Site home page Giter Site logo

Comments (6)

tchar avatar tchar commented on June 11, 2024

Hello,

Looks like the links are not preserved when you clone the repo. The USD currency flag is a symbolic link to US flag.
Looks like git converted USD.svg to a file containting US.svg.
On my computer I am developing locally so it works.

Probably you can confirm this if you copy the US flag to USD currency and restart the launcher.
Also the flags with "time" command should work because they are not symlinks.

cp ~/.local/share/ulauncher/extensions/com.github.tchar.ulauncher-albert-calculate-anything/images/flags/US.svg \
~/.local/share/ulauncher/extensions/com.github.tchar.ulauncher-albert-calculate-anything/images/flags/USD.svg

Now for this to be solved there are 2 ways I guess:

  • create copies of all currency flags instead of symlink
  • resolve the symlink problem with git

Give me an hour or two shouldn't be that hard to fix

from ulauncher-albert-calculate-anything.

tchar avatar tchar commented on June 11, 2024

Hello again @Laar3

So I found the issue. If you clone the repo directly to ulauncher extensions through git clone, it works perfectly.
For some reason when you install the extension through ulauncher it doesn't do normal git clone and just copies the contents of the file (in case of symlinks it is the name of the linked file), so you end up with normal text files.

#3 fixes this, please confirm that after you update the extension currency flags are showing.

from ulauncher-albert-calculate-anything.

Spagett1 avatar Spagett1 commented on June 11, 2024

Hello again @Laar3

So I found the issue. If you clone the repo directly to ulauncher extensions through git clone, it works perfectly.
For some reason when you install the extension through ulauncher it doesn't do normal git clone and just copies the contents of the file (in case of symlinks it is the name of the linked file), so you end up with normal text files.

#3 fixes this, please confirm that after you update the extension currency flags are showing.

ive updated but now the currency conversion doesnt do anything at all (all other functions work though) after this i tried removing the extension and manually git cloneing to the .local/share/ulauncher/extensions and the currency conversion still wouldnt work

from ulauncher-albert-calculate-anything.

Spagett1 avatar Spagett1 commented on June 11, 2024

image
forgot to upload an image

from ulauncher-albert-calculate-anything.

tchar avatar tchar commented on June 11, 2024

@Laar3

I should create a logger indipendently from ulauncher because it is not enough as the project grew in size.

All right that's a different issue. Normally if you go to extension preferences disable cache (set to None) hit save and then reenable it (hit Save again) it will fix but if you have the time to give me some logs to fix this generally I would really appreciate it.

If you want to provide the logs read below. In any case please tell me if the issue was fixed after this.

First you can check the cache of the extension.

It should be in ~/.cache/extension_calculate_anything/ and normally you can find 2 files there. One of them should be called currency_data.json. Can you open that file and confirm the contents with me?

I suspect that the last update timestamp is relatively new and the exchange rates are empty.

If the file is too big you can use this snippet to get the info from currency_data.json

python -c "import os,json;f=open(os.path.expanduser('~/.cache/extension_calculate_anything/currency_data.json'));d=json.loads(f.read());f.close();p=d.get('provider');t=d.get('last_update_timestamp');c=d.get('exchange_rates');print('provider={},timestamp={},currencies={}'.format(p, t, len(c) if c is not None else None))"

Normally by deleting the file and restarting ulauncher it should work.

However to get the proper logs so that I can find out what went wrong before deleting the file close ulauncher and open it in dev mode with no extensions

ulauncher --no-extensions --dev -v |& grep calculate-anything

Open a new terminal and type the VERBOSE command you see above. Alternatively you can find this command under the extension's preferences when you open ulauncher in dev mode. Should look like this

VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/com.github.tchar.ulauncher-albert-calculate-anything PYTHONPATH=/usr/lib/python3/dist-packages /usr/bin/python3 ~/.local/share/ulauncher/extensions/com.github.tchar.ulauncher-albert-calculate-anything/main.py

Redirect the log to a file by adding 2>&1 | tee ~/ulauncher-calculate-anything.log. So the final command should look like this.

VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/com.github.tchar.ulauncher-albert-calculate-anything PYTHONPATH=/usr/lib/python3/dist-packages /usr/bin/python3 ~/.local/share/ulauncher/extensions/com.github.tchar.ulauncher-albert-calculate-anything/main.py 2>&1 | tee ~/ulauncher-calculate-anything.log

You should see some logs in your terminal.
Type the currency conversion that fails in ulauncher and then close the terminal and post the logs at ~/ulauncher-calculate-anything.log over here.

Thanks for taking the time to help me resolve this.

from ulauncher-albert-calculate-anything.

github-actions avatar github-actions commented on June 11, 2024

Issue has been marked as stale due to no activity

from ulauncher-albert-calculate-anything.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.