summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Kwolek <wojciech@kwolek.io>2024-06-08 06:46:36 +0200
committerWojciech Kwolek <wojciech@kwolek.io>2024-06-08 06:46:36 +0200
commit972b6421f383dd8fbd80d772b23704fca87c2179 (patch)
tree6ac4481576f798e182b2c7040cce81acf891359b
parentf38465d0e280cdfb4db8b82502f5343dec4012dc (diff)
format python script
-rwxr-xr-xdmenu_raycast14
1 files changed, 8 insertions, 6 deletions
diff --git a/dmenu_raycast b/dmenu_raycast
index 219b2ec..1adfc33 100755
--- a/dmenu_raycast
+++ b/dmenu_raycast
@@ -12,13 +12,15 @@ EXTENSION = "irth/dmenu"
COMMAND = "index"
parser = argparse.ArgumentParser(
- prog='raycast_dmenu',
- description="""dmenu-like raycast extension
+ prog="raycast_dmenu",
+ description="""dmenu-like raycast extension
Provide option list as stdin, the stdout will contain the chosen option.
-If no option was chosen, the program will exit with the return code set to 1.""", formatter_class=RawDescriptionHelpFormatter)
+If no option was chosen, the program will exit with the return code set to 1.""",
+ formatter_class=RawDescriptionHelpFormatter,
+)
-parser.add_argument('-p', '--prompt', help='search bar placeholder text')
+parser.add_argument("-p", "--prompt", help="search bar placeholder text")
args = parser.parse_args()
elements = list(sys.stdin)
@@ -35,7 +37,7 @@ arguments = {
}
if args.prompt is not None:
- arguments["prompt"]=args.prompt
+ arguments["prompt"] = args.prompt
query = urlencode({"arguments": json.dumps(arguments)}, quote_via=quote)
@@ -54,6 +56,6 @@ while len(data := conn.recv(1024)) != 0:
result += data
final_result = result.decode("utf-8").strip()
-if final_result == '':
+if final_result == "":
exit(1)
print(final_result)