Skip to content
Myr

refactor variable choices into if blocks

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by kevinanew · committed by David Lord · parent 64ba434 · Browse files · 1 file+18 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−11 removed

  • other:+18 added−11 removed

1 file+18 added−11 removed

modified:src/flask/app.py+18 added-11 removed
958 unmodified lines
959 # debug passed to method overrides all other sources960 if debug is not None:961 self.debug = bool(debug)962963 _host = "127.0.0.1"964 _port = 5000963 server_name = self.config.get("SERVER_NAME")966 sn_host, sn_port = None, None964 sn_host = sn_port = None965966 if server_name:967 sn_host, _, sn_port = server_name.partition(":")968971 host = host or sn_host or _host972 # pick the first value that's not None (0 is allowed)973 port = int(next((p for p in (port, sn_port) if p is not None), _port))969 if not host:970 if sn_host:971 host = sn_host972 else:973 host = "127.0.0.1"974975 if port or port == 0:976 port = int(port)977 elif sn_port:978 port = int(sn_port)979 else:980 port = 5000981982 options.setdefault("use_reloader", self.debug)983 options.setdefault("use_debugger", self.debug)984 options.setdefault("threaded", True)985
1166 unmodified lines
2152 if request is not None:2153 # If subdomain matching is disabled (the default), use the2154 # default subdomain in all cases. This should be the default2155 # in Werkzeug but it currently does not have that feature.2149 subdomain = (2150 (self.url_map.default_subdomain or None)2151 if not self.subdomain_matching2152 else None2153 )2156 if not self.subdomain_matching:2157 subdomain = self.url_map.default_subdomain or None2158 else:2159 subdomain = None21602161 return self.url_map.bind_to_environ(2162 request.environ,2163 server_name=self.config["SERVER_NAME"],2164 subdomain=subdomain,
293 unmodified lines