From 77ce0c90ed94534ba06e391c933c3e64f4c2814f Mon Sep 17 00:00:00 2001 From: Lugiia <31995736+Lugiia@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:17:52 -0500 Subject: [PATCH] Update hatenadir/ds/v2-xx/movie.py Simplify checking the star color Co-authored-by: Peder B. Sundt --- hatenadir/ds/v2-xx/movie.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hatenadir/ds/v2-xx/movie.py b/hatenadir/ds/v2-xx/movie.py index 3c551b1..279a08c 100644 --- a/hatenadir/ds/v2-xx/movie.py +++ b/hatenadir/ds/v2-xx/movie.py @@ -82,10 +82,7 @@ class CreatorIDFileResource(resource.Resource): return self.GenerateDetailsPage(creator, ".".join(file.split(".")[:-1])).encode("UTF-8") elif filetype == "star": path = "/".join(request.path.split("/")[3:]) - try: - color = request.args.get('starcolor')[0] #colour of the star. can be green, red, blue, or purple. - except: - color = "yellow" #if starcolor arg doesn't exist, then its yellow. there's probably a better way to handle this, but I'm not fluent with python ;-; + color = request.args.get('starcolor', ["yellow"])[0] # colour of star, can be green, red, blue, or purple. Yellow otherwise. headers = request.getAllHeaders() #bad formatting