mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
LGTM report: for has redundant else, output is always overwrtitten
introduced by 2aec6e5814
This commit is contained in:
parent
ff1aea3d96
commit
8e61255a04
1 changed files with 4 additions and 11 deletions
|
@ -1102,14 +1102,11 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||
return result
|
||||
|
||||
def do_get_color_for_variable(self, name):
|
||||
# Return the color with the given name, or the empty string if there is
|
||||
# none.
|
||||
"Return the color with the given name, or the empty string if there is none."
|
||||
out, err = run_fish_cmd("echo -n $" + name)
|
||||
return out
|
||||
|
||||
def do_set_color_for_variable(
|
||||
self, name, color
|
||||
):
|
||||
def do_set_color_for_variable(self, name, color):
|
||||
"Sets a color for a fish color name, like 'autosuggestion'"
|
||||
if not name:
|
||||
raise ValueError
|
||||
|
@ -1415,12 +1412,8 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||
color = item.get("color")
|
||||
|
||||
if what:
|
||||
output = self.do_set_color_for_variable(
|
||||
what,
|
||||
color,
|
||||
)
|
||||
else:
|
||||
output = "Bad request"
|
||||
output = self.do_set_color_for_variable(what, color)
|
||||
|
||||
elif p == "/get_function/":
|
||||
what = postvars.get("what")
|
||||
output = [self.do_get_function(what[0])]
|
||||
|
|
Loading…
Reference in a new issue