File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 "Programming Language :: Python :: 3.5" ,
1818 "Programming Language :: Python :: 3.6" ,
1919 "Programming Language :: Python :: 3.7" ,
20- ' Intended Audience :: End Users/Desktop' ,
21- ' Intended Audience :: Developers' ,
22- ' Environment :: Console' ,
20+ " Intended Audience :: End Users/Desktop" ,
21+ " Intended Audience :: Developers" ,
22+ " Environment :: Console" ,
2323 ],
2424 python_requires = ">=3.5" ,
2525 description = "Simple text/ markdown links status checker" ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def link_status(link):
2121 status_code = requests .get (link , timeout = 3 ).status_code
2222 except requests .exceptions .SSLError :
2323 status_code = requests .get (link , verify = False , timeout = 3 ).status_code
24- except Exception : #noqa
24+ except Exception : # noqa
2525 # TODO: include exception in logging
2626 status_code = None
2727 pass
@@ -50,7 +50,7 @@ def main(source):
5050 links = parse_file (f )
5151
5252 if links :
53- click .echo (click .style ("File: {}" .format (f ), bg = ' blue' , fg = ' white' ))
53+ click .echo (click .style ("File: {}" .format (f ), bg = " blue" , fg = " white" ))
5454
5555 for link in links :
5656 for url in link .urls :
@@ -66,6 +66,6 @@ def main(source):
6666 "{icon} L{ln} : {l}" .format (
6767 icon = click .style (icon , fg = fg , bold = True ),
6868 ln = link .line ,
69- l = click .style (url , fg = fg )
69+ l = click .style (url , fg = fg ),
7070 )
7171 )
Original file line number Diff line number Diff line change 66
77REGULAR_EXP = r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
88
9- LINKS = namedtuple ("LINKS" , [' line' , ' urls' ])
9+ LINKS = namedtuple ("LINKS" , [" line" , " urls" ])
1010
1111
1212def parse_line (string ):
@@ -19,11 +19,11 @@ def parse_line(string):
1919 """
2020 # if `noqa` (no quality assurance) marked in line then just skip that string
2121 if "noqa" not in string :
22- html_format = markdown .markdown (string , output_format = ' html' )
22+ html_format = markdown .markdown (string , output_format = " html" )
2323 links = re .findall (REGULAR_EXP , html_format )
2424
2525 # TODO: Improve regex to remove this workaround for trailing </p> or </li>
26- links = [l .replace (' </p>' , '' ).replace (' </li>' , "" ) for l in links ]
26+ links = [l .replace (" </p>" , "" ).replace (" </li>" , "" ) for l in links ]
2727 return links
2828 else :
2929 return []
You can’t perform that action at this time.
0 commit comments