Skip to content

Commit

Permalink
Add terminator plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Sep 7, 2023
1 parent 0744b63 commit cad5a05
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FILES=*.py
FILES=bugme.py

.PHONY: all
all: flake8 pylint
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ gh#19529 closed Tue Aug 08 10:56:56 CEST 2023 Unexpected error
poo#133910 Resolved Thu Aug 17 08:50:53 CEST 2023 We need a suite of tests to check volume operations in container runtimes
```

## Terminator plugin

Copy [terminator.py](terminator.py) to `~/.config/terminator/plugins/`

## Requirements

- Tested on Python 3.8+
Expand Down
75 changes: 75 additions & 0 deletions terminator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
"""
Plugin for terminator
Copy this file to $HOME/.config/terminator/plugins/
Based on:
https://terminator-gtk3.readthedocs.io/en/latest/plugins.html
"""

import re
import terminatorlib.plugin as plugin

AVAILABLE = ['cve', 'suse_bugzilla', 'suse_jira', 'suse_incident', 'suse_fate', 'suse_progress']


class base(plugin.URLHandler):
capabilities = ['url_handler']

def callback(self, line):
for item in re.findall(self._extract, line):
return self._url + item


class cve(base):
handler_name = 'cve'
match = r'\bCVE-[0-9]+-[0-9]+\b'
nameopen = "Open CVE item"
namecopy = "Copy CVE URL"
_extract = '[0-9]+-[0-9]+'
_url = 'https://cve.mitre.org/cgi-bin/cvename.cgi?name='


class suse_bugzilla(base):
handler_name = 'suse_bugzilla'
match = r'\b(bsc|bnc|boo)#[0-9]+\b'
nameopen = "Open Bugzilla item"
namecopy = "Copy Bugzilla URL"
_extract = '[0-9]+'
_url = 'https://bugzilla.suse.com/show_bug.cgi?id='


class suse_jira(base):
handler_name = 'suse_jira'
match = r'\bjsc#[A-Z]+-[0-9]+\b'
nameopen = "Open Jira item"
namecopy = "Copy Jira URL"
_extract = '[A-Z]+-[0-9]+'
_url = 'https://jira.suse.com/browse/'


class suse_incident(base):
handler_name = 'suse_incident'
match = r'\bS(USE)?:M(aintenance)?:[0-9]+:[0-9]+\b'
nameopen = "Open Incident item"
namecopy = "Copy Incident URL"
_extract = '[0-9]+'
_url = 'https://smelt.suse.de/incident/'


class suse_fate(base):
handler_name = 'suse_fate'
match = r'\bFATE:[0-9]+\b'
nameopen = "Open FATE item"
namecopy = "Copy FATE URL"
_extract = '[0-9]+'
_url = 'https://fate.suse.com/'


class suse_progress(base):
handler_name = 'suse_progress'
match = r'\bpoo#[0-9]+\b'
nameopen = "Open POO item"
namecopy = "Copy POO URL"
_extract = '[0-9]+'
_url = 'https://progress.opensuse.org/issues/'

0 comments on commit cad5a05

Please sign in to comment.