Coder Social home page Coder Social logo

brpaz / ulauncher-github Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 12.0 7.06 MB

Ulauncher Extension that provides quick access to common GitHub functionality like your repositories or gists.

Home Page: https://ext.ulauncher.io/-/github-brpaz-ulauncher-github

License: MIT License

Makefile 2.86% Python 97.14%
ulauncher ulauncher-extension github

ulauncher-github's Introduction

Ulauncher Github

ulauncher Extension that provides quick access to common GitHub functionality like your repositorie, assigned issues or Pull Requests and many more. CI Status Ulauncher Extension License

Usage

demo

Features

  • Quick access to your repositories and organizations.
  • Access to your Issues and Pull Requests (Assigned, Created)
  • Search public repos and users
  • Search on GitHub Documentation pages

Getting started

Pre-Requisites

This extension requires Python > 3 and a few python packages installed on your system.

To install them, you can run the following command, on your terminal:

pip install -r https://github.com/brpaz/ulauncher-github/blob/master/requirements.txt

Install the extension

Open ulauncher preferences window -> extensions -> add extension and paste the following url:

https://github.com/brpaz/ulauncher-github

Extension Settings

Before being able to start using the extension, you must generate a Personal Access Token (PAT) and configure it in the extension settings. The access token will allow the extension to access the GitHub API.

You can generate yours here. Make sure you select at least the permissions for "repo", "read:org", "gist", "user" and "notifications", otherwise you might see errors when using some specific commands in the extension.

Usage

This extension provides various commands/keywords to access the different functionality. If you type GitHub in Ulauncher you should see the available commands.

Extension Screenshot

These include:

  • GitHub: Search Repositories
  • GitHub: Search Users
  • GitHub: My Gists
  • GitHub: My Organizations
  • GitHub: My Assigned Issues
  • GitHub: My Created Issues
  • GitHub: My Assigned Pull Requests
  • GitHub: My Created Pull Requests
  • GitHub: My Notifications
  • GitHub: My Repositories
  • GitHub: My Account
  • GitHub: Search Documentation
  • GitHub: Extension Options

Note on Cache

When the extension starts, it will download a list of all of your repositories, stars and gists and save them in a json file. This helps for performance reasons and GitHub API doesnΒ΄t have a way to search on your own and organizations repostories in the same request.

This information is cached for 1 day by default. You can clear your cache and trigger a reindex of the local data by restarting ulauncher or by going to GitHub: Extension Options -> Refresh cache.

Depending on the number of repositories you have access, this indexing process might take some time. It is executed in the background and you will receive a notification when the process finishes.

Development

git clone https://github.com/brpaz/ulauncher-github
make link

The make link will create a symbolic link to the ulauncher extensions folder.

Next, stop Ulauncher if running and run the following command:

make dev

This will start Ulauncher from the command line with all extensions disabled. In the output you will see something like this:

 VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/com.github.brpaz.ulauncher-github PYTHONPATH=/usr/lib/python3.8/site-packages /usr/bin/python3 /home/bruno/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/main.py

Run this, command in another terminal window, to laucnh the GitHub Extension.

TODO

  • Cache user repositories, gists and organizations in background for faster results.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ’› Support the project

If this project was useful to you in some form, I would be glad to have your support. It will help to keep the project alive and to have more time to work on Open Source.

The sinplest form of support is to give a ⭐️ to this repo.

You can also contribute with GitHub Sponsors.

GitHub Sponsors

Or if you prefer a one time donation to the project, you can simple:

Buy Me A Coffee

πŸ“ License

Copyright Β© 2020 Bruno Paz.

This project is MIT licensed.

ulauncher-github's People

Contributors

brpaz avatar julianhille avatar rajalokan avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ulauncher-github's Issues

error install

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement github (from versions: none)
ERROR: No matching distribution found for github

Failed to install

Fedora 33, MATE

Message: 'com.github.brpaz.ulauncher-github'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3.9/site-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3.9/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 444, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3.9/site-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-github'

[Bug]: Error with dependencies

Description?

error Installing the required dependencies pip install -r https://raw.githubusercontent.com/brpaz/ulauncher-github/master/requirements.txt

ERROR: Invalid requirement: 'pygithub=~1.55' (from line 1 of https://raw.githubusercontent.com/brpaz/ulauncher-github/master/requirements.txt)
Hint: = is not a valid operator. Did you mean == ?

image

image

image

Extension Logs

~  πŸ”Œ 42%  ulauncher -v --dev |& grep "ulauncher-github"
2022-08-11 18:29:23,941 | INFO | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-github" started. PID 36403
2022-08-11 18:29:24,572 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-github" exited instantly with code 1
2022-08-11 18:29:24,572 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-github" failed with an error: ModuleNotFoundError: No module named 'github'
  File "/home/acosta/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/main.py", line 3, in <module>
  File "/home/acosta/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/gh/extension.py", line 23, in <module>
  File "/home/acosta/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/gh/listeners/preferences.py", line 4, in <module>

[Bug]: Error on installing dependencies

Description?

[hrq@fedora ~]$ pip install -r https://github.com/brpaz/ulauncher-github/blob/master/requirements.txt
Defaulting to user installation because normal site-packages is not writeable
WARNING: Cache entry deserialization failed, entry ignored
ERROR: Invalid requirement: '<!DOCTYPE html>' (from line 8 of https://github.com/brpaz/ul

Extension Logs

None

UnhandledError -> com.github.brpaz.ulauncher-github

Message: 'com.github.brpaz.ulauncher-github'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3.7/site-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3.7/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 425, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3.7/site-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-github'

I am trying to make change on github keyword but it show me this error

error on setting PAT

Installed ok, then created a new Personal Access Token and then pasted to settings. Then error arised

Message: 'com.github.brpaz.ulauncher-github'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3/dist-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 436, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3/dist-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-github'

Issues with logging

Hello,

Thanks for awesome extension but there is one small issue: it logs every repo and distracts from developing other extensions

Small video:

vid.mp4

It happened when I launched using ulauncher -v

error when saving github access token

Message: 'com.github.brpaz.ulauncher-github'
Error Name: UnhandledError
Type: KeyError

Stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 198, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python3/dist-packages/ulauncher/utils/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python3/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 425, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python3/dist-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-github'

i got the error above when trying to save the github access token

gh search does not return results

Description

If you type gh search symfony or gh gists it will return the following error:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Client.py", line 54, in on_message
    self.extension.trigger_event(event)
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
    action = listener.on_event(event, self)
  File "/home/steve/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/main.py", line 470, in on_event
    return extension.search_public_repos(search[0].strip())
  File "/home/steve/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-github/main.py", line 353, in search_public_repos
    on_alt_enter=CopyToClipboardAction(repo.html_url)))
  File "/usr/lib/python3/dist-packages/ulauncher/api/shared/item/ExtensionResultItem.py", line 18, in __init__
    super(ExtensionResultItem, self).__init__(*args, **kw)
  File "/usr/lib/python3/dist-packages/ulauncher/api/shared/item/ResultItem.py", line 44, in __init__
    raise TypeError('"description" must be of type "str", "%s" given' % type(description).__name__)
TypeError: "description" must be of type "str", "bytes" given

Environment info

$ lsb_release  -a
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan

$ ulauncher --version
ulauncher 5.7.0

$ python3 --version
Python 3.7.5

$ pip3 list | grep -i pygit
PyGithub 1.46 

clone repo

What about adding an option to clone the repo using

gh clone repo_url

to the home directory?

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.