diff options
-rw-r--r-- | db.py | 20 | ||||
-rwxr-xr-x | lidecli.py | 9 | ||||
-rw-r--r-- | parsing_callbacks.py (renamed from callbacks.py) | 0 |
3 files changed, 15 insertions, 14 deletions
@@ -75,7 +75,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_maximized" }, @@ -90,7 +90,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_maximized_horizontal" }, @@ -105,7 +105,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_maximized_vertical" }, @@ -120,7 +120,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_minimized" }, @@ -135,7 +135,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_modal" }, @@ -150,7 +150,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_sticky" }, @@ -165,7 +165,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_shaded" }, @@ -180,7 +180,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_fullscreen" }, @@ -195,7 +195,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_above" }, @@ -210,7 +210,7 @@ def commands(): "versions_working": [("x11", "all")], "versions_not_working": [], "command": "xprop -id #1#", - "callback": { + "callback_parser": { "function": "xprop_parser", "output_key": "win_below" }, @@ -6,7 +6,7 @@ import sys import json import os import configparser -import callbacks +import parsing_callbacks import db version = "1.0.2" @@ -112,10 +112,11 @@ def exec_command(args): print("Command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) return ret = ret.decode('utf-8') - if "callback" in command: - function = getattr(callbacks, command["callback"]["function"]) + if "callback_parser" in command: + function = getattr(parsing_callbacks, command["callback_parser"]["function"]) ret = function(ret) - print(ret["win_maximized"], end='') + ret = ret[command['callback_parser']['output_key']] + # print(ret["win_maximized"], end='') else: print(ret, end='') if (args.store): diff --git a/callbacks.py b/parsing_callbacks.py index 70ea1da..70ea1da 100644 --- a/callbacks.py +++ b/parsing_callbacks.py |