gistfinder icon indicating copy to clipboard operation
gistfinder copied to clipboard

TypeError when changing base URL

Open kylemarsh opened this issue 4 years ago • 3 comments

I wanted to use this for work, so I tried changing the base URL from api.github.com to api.github.$workdomain.com in the two places I found it in config.py (I wanted to do a quick test before adding a new config option and submitting a PR) and while syncing works fine I get a TypeError when trying to launch the viewer: TypeError: sequence item 1: expected str instance, NoneType found

I browsed the sqlite database and nothing jumps out at me as being obviously missing.

kylemarsh avatar Feb 03 '21 17:02 kylemarsh

@kylemarsh I don't suppose there's any way you could share ~/.config/gistfinder/database.sqlite with me is there? If not, could you post the whole stack trace?

robdmc avatar Feb 03 '21 18:02 robdmc

Actually... @kylemarsh I think I found the problem. Fix incoming.

robdmc avatar Feb 03 '21 19:02 robdmc

@kylemarsh Just pushed new version

pip install -U gistfinder

Should give you version 0.2.4

I don't expect your use case to be very common, so, for now I didn't want to create a separate config for it. I might in the future.

But... to keep you from having to edit any code or keep a fork in sync, try this.

# Replace the values in quotes with your enterprise links (maybe add this to your .bashrc)
export GISTFINDER_API_URL="'https://api.github.com/users"
export GISTFINDER_URL="https://gist.github.com"

gistfinder --reset

Since I don't have access to enterprise account, I have no way to test it. Would you be able to tell me if it works?

Also... a bit of a shameless plug, but at work I'm constantly juggling access urls/keys for different services. I wrote this so I could put all that config in a central place and just run my day-to-day with env vars placing me in the appropriate context. https://github.com/robdmc/switchenv

robdmc avatar Feb 03 '21 19:02 robdmc