Skip to content

Commit

Permalink
Merge pull request #4 from beide/master
Browse files Browse the repository at this point in the history
2 bugfixes
  • Loading branch information
saturngod committed Nov 13, 2012
2 parents e63d55d + 1777a47 commit 0480e42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 4 additions & 3 deletions makePDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

parts = []

title = path
if(title[-1:]=="/"):
title = title[:len(title)-1]
title = os.path.abspath(path)

title = os.path.basename(os.path.dirname(title)) + \
"-" + os.path.basename(title)

title = title.replace("/","-")

Expand Down
10 changes: 6 additions & 4 deletions makepub.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@


def get_title(path):
title = path
if(title[-1:] == "/"):
title = title[:len(title) - 1]
title = title.replace("/", "-")
title = os.path.abspath(path)

title = os.path.basename(os.path.dirname(title)) + \
"-" + os.path.basename(title)
title = title.replace("/","-")

return title


Expand Down
7 changes: 4 additions & 3 deletions mdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def getit(dirname,target_url):
if not os.path.exists(dirname+"/"+chapter+"-"+name):
urlretrieve(url, dirname+"/"+chapter+"-"+name)

getit(dirname,next_url)
return next_url

except urllib2.URLError, e:
print ">>> Fail at "+target_url
Expand All @@ -53,5 +53,6 @@ def getit(dirname,target_url):
print ">>> Start cleaning"
cleanup(dirname)


getit(sys.argv[2],sys.argv[1])
nexturl = sys.argv[1]
while nexturl:
nexturl = getit(sys.argv[2],nexturl)

0 comments on commit 0480e42

Please sign in to comment.