Improve handling of existing issues, only abort after five consecutive failures, Come On Eileen.
This commit is contained in:
parent
6bdd458df3
commit
2d55c9337a
1 changed files with 11 additions and 1 deletions
12
getter.py
12
getter.py
|
@ -43,6 +43,7 @@ def getIssue(issue, makepdf = True):
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
if i == 1:
|
if i == 1:
|
||||||
|
os.rmdir(str(issue))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if i < 5:
|
if i < 5:
|
||||||
|
@ -51,10 +52,19 @@ def getIssue(issue, makepdf = True):
|
||||||
if makepdf:
|
if makepdf:
|
||||||
makePDF(issue, i-1)
|
makePDF(issue, i-1)
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("[NOTICE] Skipping issue: %i (already exists)" % issue)
|
||||||
|
|
||||||
def getterLoop(start = 53):
|
def getterLoop(start = 53):
|
||||||
i = start
|
i = start
|
||||||
|
j = 0
|
||||||
|
|
||||||
|
while j < 5:
|
||||||
|
if getIssue(i) is False:
|
||||||
|
j += 1
|
||||||
|
else:
|
||||||
|
j = 0
|
||||||
|
|
||||||
while getIssue(i) is not False:
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue