Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 5104a11

Browse files
[docker] v3
1 parent ba086e8 commit 5104a11

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

docker/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import docker
77
from albert import *
88

9-
md_iid = "2.3"
10-
md_version = "3.0"
9+
md_iid = "3.0"
10+
md_version = "4.0"
1111
md_name = "Docker"
1212
md_description = "Manage docker images and containers"
1313
md_license = "MIT"
@@ -22,15 +22,17 @@ class Plugin(PluginInstance, TriggerQueryHandler):
2222

2323
def __init__(self):
2424
PluginInstance.__init__(self)
25-
TriggerQueryHandler.__init__(
26-
self, self.id, self.name, self.description,
27-
defaultTrigger='d ',
28-
synopsis='<image tag|container name>'
29-
)
25+
TriggerQueryHandler.__init__(self)
3026
self.icon_urls_running = [f"file:{Path(__file__).parent}/running.png"]
3127
self.icon_urls_stopped = [f"file:{Path(__file__).parent}/stopped.png"]
3228
self.client = None
3329

30+
def synopsis(self, query):
31+
return "<image tag|container name>"
32+
33+
def defaultTrigger(self):
34+
return "d "
35+
3436
def handleTriggerQuery(self, query):
3537
items = []
3638

@@ -61,7 +63,7 @@ def handleTriggerQuery(self, query):
6163
Action("remove", "Remove (forced, with volumes)",
6264
lambda c=container: c.remove(v=True, force=True)),
6365
Action("copy-id", "Copy id to clipboard",
64-
lambda id=container.id: setClipboardText(id))
66+
lambda cid=container.id: setClipboardText(cid))
6567
])
6668

6769
items.append(StandardItem(

0 commit comments

Comments
 (0)