Skip to content

Commit

Permalink
Add support for non-separated books
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Feb 3, 2013
1 parent 3794347 commit fc95b7b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions books.py
Expand Up @@ -43,18 +43,32 @@


series = [series[k] for k in args] series = [series[k] for k in args]


def infiniteRange():
i = 1
while True:
yield i
i +=1

for s in series: for s in series:
print s print s
page = s.startPage page = s.startPage
index = 1 index = 1
while page!=None: while page!=None:
folder = "%s #%02d"%(s.description, index) if opts.count == -1:
folder = s.description
else:
folder = "%s #%02d"%(s.description, index)
toc = tocStart(folder) toc = tocStart(folder)
titlePattern = compile(s.titlePattern, DOTALL | MULTILINE) titlePattern = compile(s.titlePattern, DOTALL | MULTILINE)
contentPattern = compile(s.contentPattern, DOTALL | MULTILINE) contentPattern = compile(s.contentPattern, DOTALL | MULTILINE)
nextPattern = compile(s.nextPattern, DOTALL | MULTILINE) nextPattern = compile(s.nextPattern, DOTALL | MULTILINE)
newitems = False newitems = False
for x in range(opts.count): if opts.count == -1:
items = infiniteRange()
else:
items = range(opts.count)

for x in items:
print "generating", page print "generating", page
age = -1 age = -1
while True: while True:
Expand Down

0 comments on commit fc95b7b

Please sign in to comment.