-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil-menus.py
More file actions
33 lines (22 loc) · 763 Bytes
/
util-menus.py
File metadata and controls
33 lines (22 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import hexchat
__module_name__ = "UtilMenus"
__module_author__ = "linuxdaemon"
__module_version__ = "0.1.0"
__module_description__ = "Adds various menu options for general util functions"
MENU_ITEMS = frozenset({
("$NICK/Services Info", "NS info %s"),
("$CHAN/Services Info", "CS info %s"),
("$TAB/Services Info", "CS info %s"),
})
def add_menu_items():
for path, cmd in MENU_ITEMS:
hexchat.command("MENU ADD \"{}\" \"{}\"".format(path, cmd))
def del_menu_items():
for path, cmd in MENU_ITEMS:
hexchat.command("MENU DEL \"{}\"".format(path))
def unload(userdata):
del_menu_items()
print(__module_name__, "plugin unloaded")
hexchat.hook_unload(unload)
add_menu_items()
print(__module_name__, "plugin loaded")