dotfiles/i3/scripts/dmenu/modules/Module.py

26 lines
919 B
Python
Raw Normal View History

2018-04-05 05:30:27 +02:00
class Module(object):
"""Abstract class, implement: build_db, update_db, build_menu, call"""
def __init__(self, obj):
pass
def build_db():
"""Function which adds entries to the database.
returns dict with:
Name, json, disabled, type, "file" """
raise NotImplementedError("Should have implemented this")
def update_db(database: dict):
"""Function which updates entries in the database.
returns dict with modified/deleted/added database entries"""
raise NotImplementedError("Should have implemented this")
def build_menu(items: dict):
"""Builds the menu entries.
return list of tuples (id, name, hits)"""
raise NotImplementedError("Should have implemented this")
def call(entry: str):
"""Handles the selected entry"""
raise NotImplementedError("Should have implemented this")