git @ Cat's Eye Technologies yastasoti / e675d71
Continue to clean up. Chris Pressey 5 years ago
1 changed file(s) with 6 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
00 #!/usr/bin/env python
11
2 from os.path import realpath, dirname, join
2 from argparse import ArgumentParser
3 import hashlib
4 import json
5 import os
6 #from subprocess import check_call
37 import sys
4
5 sys.path.insert(0, join(dirname(realpath(sys.argv[0])), '..', 'src'))
6
7 from argparse import ArgumentParser
8 import json
9 import sys
10 import hashlib
11 import os
128 from time import sleep, localtime, strftime
139 import urllib
1410
7268 def __init__(self, links, article_root=None, ignore_urls=None):
7369 self.links = links
7470 self.article_root = article_root
75 self.missing_only = missing_only
7671 self.ignore_urls = ignore_urls or []
7772
7873 def handle_link(self, url):
9388 else:
9489 filename = url
9590 filename = urllib.unquote(filename)
96 filename = os.path.join(article_root, filename)
91 filename = os.path.join(self.article_root, filename)
9792 if not os.path.exists(filename):
9893 raise ValueError('Local file "{}" does not exist'.format(filename))
9994 continue