Compare commits
1 Commits
4dadfaa162
...
1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 28b39374ae |
23
__init__.py
23
__init__.py
@@ -4,10 +4,10 @@ from uuid import uuid4
|
||||
|
||||
import albert
|
||||
|
||||
md_iid = '4.0'
|
||||
md_iid = '5.0'
|
||||
md_name = "UUID Generator"
|
||||
md_description = "Generate version 4 UUID(s)"
|
||||
md_version = "0.0.1"
|
||||
md_version = "1.0.0"
|
||||
md_license = "MIT"
|
||||
md_url = "https://gitea.felix-boers.de/fboers/albert-plugin-python-uuid-generator"
|
||||
md_authors = ["@felixboers"]
|
||||
@@ -29,32 +29,31 @@ def build_query_items(uuids):
|
||||
albert.StandardItem(
|
||||
id='uuid',
|
||||
text=uuid,
|
||||
icon_factory=lambda: albert.makeImageIcon(icon_path),
|
||||
icon_factory=lambda: albert.Icon.image(icon_path),
|
||||
subtext=uuid,
|
||||
actions=[
|
||||
albert.Action(
|
||||
id='copy',
|
||||
text='Copy uuid to clipboard',
|
||||
callable=lambda id=uuid: albert.setClipboardText(id)
|
||||
'copy',
|
||||
'Copy uuid to clipboard',
|
||||
lambda id_=uuid: albert.setClipboardText(id_)
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
return results
|
||||
|
||||
class Plugin(albert.PluginInstance, albert.TriggerQueryHandler):
|
||||
class Plugin(albert.PluginInstance, albert.GeneratorQueryHandler):
|
||||
|
||||
def __init__(self):
|
||||
albert.PluginInstance.__init__(self)
|
||||
albert.TriggerQueryHandler.__init__(self)
|
||||
albert.GeneratorQueryHandler.__init__(self)
|
||||
|
||||
def defaultTrigger(self):
|
||||
return 'uuid '
|
||||
|
||||
def handleTriggerQuery(self, query):
|
||||
if not query.isValid:
|
||||
def items(self, ctx):
|
||||
if not ctx.isValid:
|
||||
return
|
||||
|
||||
uuid = str(uuid4())
|
||||
formats = expand_uuid_formats(uuid)
|
||||
query.add(build_query_items(formats))
|
||||
yield [i for i in build_query_items(formats)]
|
||||
|
||||
Reference in New Issue
Block a user