Whitespace sucks.
This commit is contained in:
parent
2db3661ec8
commit
b27817d008
@ -122,14 +122,10 @@ def main(user, password, server, label, inout_file, path ):
|
|||||||
|
|
||||||
if not urls: return
|
if not urls: return
|
||||||
urls = set(parse_url(x) for x in urls)
|
urls = set(parse_url(x) for x in urls)
|
||||||
|
log("URLs to parse: {}".format(", ".join(urls)), 'HEADER')
|
||||||
|
|
||||||
if len(urls): log("URLs to parse: {}".format(", ".join(urls)), 'BLUE')
|
|
||||||
|
|
||||||
loc = mkdtemp()
|
loc = mkdtemp()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for url in urls:
|
for url in urls:
|
||||||
log("Working with url {}".format(url), 'HEADER')
|
log("Working with url {}".format(url), 'HEADER')
|
||||||
storyId = None
|
storyId = None
|
||||||
@ -153,7 +149,10 @@ def main(user, password, server, label, inout_file, path ):
|
|||||||
res = check_output('{}fanficfare -u "{}" --update-cover'.format(moving, cur), shell=True,stderr=STDOUT,stdin=PIPE, )
|
res = check_output('{}fanficfare -u "{}" --update-cover'.format(moving, cur), shell=True,stderr=STDOUT,stdin=PIPE, )
|
||||||
check_regexes(res)
|
check_regexes(res)
|
||||||
if chapter_difference.search(res) or more_chapters.search(res):
|
if chapter_difference.search(res) or more_chapters.search(res):
|
||||||
log("\tForcing download update due to:\n\t\t\t{}".format(res.replace("\n", "\n\t\t\t")), 'WARNING')
|
log("\tForcing download update due to:", 'WARNING')
|
||||||
|
for line in res.split("\n"):
|
||||||
|
if line:
|
||||||
|
log("\t\t{}".format(line), 'WARNING')
|
||||||
res = check_output('{}fanficfare -u "{}" --force --update-cover'.format(moving, cur), shell=True,stderr=STDOUT,stdin=PIPE, )
|
res = check_output('{}fanficfare -u "{}" --force --update-cover'.format(moving, cur), shell=True,stderr=STDOUT,stdin=PIPE, )
|
||||||
check_regexes(res)
|
check_regexes(res)
|
||||||
cur = get_files(loc, '.epub', True)[0]
|
cur = get_files(loc, '.epub', True)[0]
|
||||||
@ -188,7 +187,10 @@ def main(user, password, server, label, inout_file, path ):
|
|||||||
log("Downloaded story {} to {}".format(story_name.search(name).group(1), name), 'GREEN')
|
log("Downloaded story {} to {}".format(story_name.search(name).group(1), name), 'GREEN')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log("Exception: {}".format(e), 'FAIL')
|
log("Exception: {}".format(e), 'FAIL')
|
||||||
|
try:
|
||||||
rmtree(loc)
|
rmtree(loc)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
loc = mkdtemp()
|
loc = mkdtemp()
|
||||||
with open(inout_file, "a") as fp:
|
with open(inout_file, "a") as fp:
|
||||||
fp.write("{}\n".format(url))
|
fp.write("{}\n".format(url))
|
||||||
|
Loading…
Reference in New Issue
Block a user