Coder Social home page Coder Social logo

brpaz / ulauncher-gitlab Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 15.0 2.38 MB

Ulauncher extension to interact with GitLab.

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

License: MIT License

Makefile 5.69% Python 94.31%
ulauncher ulauncher-extension gitlab

ulauncher-gitlab's Introduction

Ulauncher GitLab

Ulauncher extension to interact with GitLab.

Ulauncher Extension CI Status license

Demo

demo

Features

  • Search public projects
  • Search your starred projects
  • Search your private Projects.
  • Search your Groups
  • Provides quick access to common GitLab pages like your Issues, Todos and Merge Requests.
  • Shortcuts for Gitlab.com and GitLab status page.
  • Supports both hosted GitLab.com and On-Premise.

Requirements

Install

First install all the Python depdendencies needed by this extension:

sudo apt install python3-pip
pip3 install "python-gitlab >=1.5.1,<2.0.0"

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

<%= https://github.com/brpaz/ulauncher-gitlab %>

Usage

Before using the extension, you must configure your GitLab access token in the plugin settings. You can yours here.

Development

make link
make dev

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

Copywright @ 2019 Bruno Paz

This project is MIT Licensed.

ulauncher-gitlab's People

Contributors

ajoy39 avatar brpaz avatar cmuench avatar matheusfillipe avatar

Stargazers

 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-gitlab's Issues

invalid syntax when running an extension

/usr/lib/python3.7/site-packages/ulauncher/main.py:8: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/home/u/.local/share:/var/lib/flatpak/exports/share/ulauncher/extensions/com.github.brpaz.ulauncher-gitlab/main.py", line 8, in <module>
    from ulauncher.api.shared.item.ExtensionResultItem import ExtensionResultItem
  File "/usr/lib/python3.7/site-packages/ulauncher/api/shared/item/ExtensionResultItem.py", line 6, in <module>
    from ulauncher.utils.image_loader import load_image
  File "/usr/lib/python3.7/site-packages/ulauncher/utils/image_loader.py", line 10, in <module>
    from ulauncher.config import get_data_file
  File "/usr/lib/python3.7/site-packages/ulauncher/config.py", line 12, in <module>
    from uuid import uuid4
  File "/usr/lib/python3.7/site-packages/uuid.py", line 138
    if not 0 <= time_low < 1<<32L:
                                ^
SyntaxError: invalid syntax

Dependency confusion / Unexpected API error

There seem to be two packages: gitlab and python-gitlab available. Since the README only mentions the latter, I only installed that one. During startup this now prints:

Traceback (most recent call last):
  File "/home/marcus/.cache/ulauncher_cache/extensions/com.github.brpaz.ulauncher-gitlab/main.py", line 4, in <module>
    import gitlab
ImportError: No module named gitlab

When entering my API token and saving, I get the error messages described in #1:

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

So I tried installing gitlab, too. This replaces the error message on startup so it reads

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ulauncher/api/client/Client.py", line 52, in on_message
    self.extension.trigger_event(event)
  File "/usr/lib/python2.7/site-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
    action = listener.on_event(event, self)
  File "/home/marcus/.cache/ulauncher_cache/extensions/com.github.brpaz.ulauncher-gitlab/main.py", line 270, in on_event
    extension.gitlab = gitlab.Gitlab(
AttributeError: 'module' object has no attribute 'Gitlab'

The same error also occurs when trying to save the access token, so I guess it's safe to say that this module really isn't supposed to be used.
Unfortunately I have no idea how to resolve ImportError: No module named gitlab and the KeyErrror.

In #1, @utrack suggested that one should also install the logging and re packages. But when I install logging, a lot of errors in the vein of ImportError: cannot import name NullHandler start popping up. And the re package doesn't seem to exist: Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/re/

Any ideas? Btw, your ulauncher plugins really are fantastic - thank you very much for sharing your great work! ๐ŸŽ‰

Error to save token and URL

Message: 'com.github.brpaz.ulauncher-gitlab'
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-gitlab'

UnhandledError

How I triggered it:

  • Changed the keyword from glab to git
  • Changed the URL to the self-hosted instance.
  • Entered my token (with api scope).

End result:

Message: 'com.github.brpaz.ulauncher-gitlab'
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 417, 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-gitlab'

I've tried switching a field or two and I always seem to trigger this stacktrace. I've tried leaving the keyword to glab, as well as using GitLab.com access token instead of my own instance.

Does not load suggestions

Just wanted to try out the extension but it is not working out for me ๐Ÿ˜…

I installed python-gitlab and added a personal access token. But it is still just "loading".

Is there anything I missed? ๐Ÿค”

[Bug]: On-premise installation is giving 401's.

Description?

I followed the instructions, installing the extension, pointing towards the on-premise URI, and giving it the Token generated from Profile>Personal Access Tokens (I gave it all perms there too, just to check). No other errors thrown, but when I type glab and start typing anything past that (or I select the pre-populated ones like "Me"), it just shows one result that says 401: Authorization Error

Extension Logs

2022-11-14 21:21:41,282 | INFO | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.brpaz.ulauncher-gitlab" started. PID 255124
2022-11-14 21:21:41,447 | INFO | ulauncher.api.server.ExtensionController: handleConnected() | Extension "com.github.brpaz.ulauncher-gitlab" connected
2022-11-14 21:21:41,447 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event PreferencesEvent to "com.github.brpaz.ulauncher-gitlab"
2022-11-14 21:21:50,585 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.brpaz.ulauncher-gitlab"
2022-11-14 21:21:50,605 | DEBUG | ulauncher.api.server.ExtensionController: handleMessage() | Incoming response (KeywordQueryEvent, RenderResultListAction) from "com.github.brpaz.ulauncher-gitlab"
2022-11-14 21:21:52,529 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.brpaz.ulauncher-gitlab"
2022-11-14 21:21:52,683 | DEBUG | ulauncher.api.server.ExtensionController: handleMessage() | Incoming response (KeywordQueryEvent, RenderResultListAction) from "com.github.brpaz.ulauncher-gitlab"

Unexpected API error. KeyError: com.github.brpaz.ulauncher-gitlab

Hi! This looks like a neat plugin ๐Ÿ‘
However, I can't get it to work - I receive KeyError w/o any better trace data when trying to auth vs both on-prem gitlab and official gitlab.com.

2018-08-22 16:35:48,840 | ERROR | ulauncher.ui.windows.PreferencesUlauncherDialog: on_scheme_callback() | Unexpected API error. KeyError: com.github.brpaz.ulauncher-gitlab
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 160, in on_scheme_callback
    resp = rt.dispatch(self, scheme_request.get_uri())
  File "/usr/lib/python2.7/site-packages/ulauncher/util/Router.py", line 49, in dispatch
    return callback(context, url_params)
  File "/usr/lib/python2.7/site-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py", line 368, in prefs_extension_update_prefs
    controller = ExtensionServer.get_instance().get_controller(ext_id)
  File "/usr/lib/python2.7/site-packages/ulauncher/api/server/ExtensionServer.py", line 76, in get_controller
    return self.controllers[extension_id]
KeyError: 'com.github.brpaz.ulauncher-gitlab'

Don't work

Description?

Hello,
Great idea like extension, but are not working on ulauncher v5.14.0
Didn't load the projects. (I use personal gitlab)

Extension Logs

No response

Error to save token and URL

Message: 'com.github.brpaz.ulauncher-gitlab'
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-gitlab'

Impossible to access to the functionality

image

I have installed gitlab via pip and also todoist, but still impossible to access at the functionality, I double-checked also the token generating a new one with all the privileges, but still not working, am I doing something wrong?

How can I use a dedicated environment?

Thanks for this amazing extension, it's very useful!

I'm wondering if there is a way to use a dedicated environment for this instead of installing it in my user path. I would like to install python-gitlab in a environment and using it from there, something like:

conda create -n ulauncher python=3.6 -y
conda activate ulauncher
pip install python-gitlab  # avoiding --user option

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.