diff options
| author | Wojciech Kwolek <wojciech@kwolek.io> | 2024-06-08 06:46:36 +0200 |
|---|---|---|
| committer | Wojciech Kwolek <wojciech@kwolek.io> | 2024-06-08 06:46:36 +0200 |
| commit | 972b6421f383dd8fbd80d772b23704fca87c2179 (patch) | |
| tree | 6ac4481576f798e182b2c7040cce81acf891359b | |
| parent | f38465d0e280cdfb4db8b82502f5343dec4012dc (diff) | |
format python script
| -rwxr-xr-x | dmenu_raycast | 14 |
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) |
