forked from loafle/openapi-generator-original
[BUG][python] Fix PEP8 E111 issue in rest.mustache (#12229)
* Fix PEP8 E111 issue * Update samples
This commit is contained in:
parent
4ee5f72214
commit
6f1fa4592b
@ -290,10 +290,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -333,6 +333,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
@ -298,10 +298,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
@ -298,10 +298,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
@ -298,10 +298,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
@ -298,10 +298,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
@ -298,10 +298,10 @@ def is_ipv4(target):
|
|||||||
""" Test if IPv4 address or not
|
""" Test if IPv4 address or not
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
chk = ipaddress.IPv4Address(target)
|
chk = ipaddress.IPv4Address(target)
|
||||||
return True
|
return True
|
||||||
except ipaddress.AddressValueError:
|
except ipaddress.AddressValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def in_ipv4net(target, net):
|
def in_ipv4net(target, net):
|
||||||
""" Test if target belongs to given IPv4 network
|
""" Test if target belongs to given IPv4 network
|
||||||
@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):
|
|||||||
|
|
||||||
if is_ipv4(parsed.hostname):
|
if is_ipv4(parsed.hostname):
|
||||||
for item in entries:
|
for item in entries:
|
||||||
if in_ipv4net(parsed.hostname, item):
|
if in_ipv4net(parsed.hostname, item):
|
||||||
return True
|
return True
|
||||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user