mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
small changes to make work on other machines. why there's no Python 2.6 on Ubuntu?
This commit is contained in:
parent
6e73e5dc11
commit
d2d183430d
2 changed files with 2 additions and 3 deletions
1
ffa.py
1
ffa.py
|
|
@ -93,6 +93,7 @@ class FFA:
|
||||||
if url.find('http://') == -1:
|
if url.find('http://') == -1:
|
||||||
url = 'http://' + self.host + '/' + url
|
url = 'http://' + self.host + '/' + url
|
||||||
|
|
||||||
|
logging.info('Downloading: %s' % url)
|
||||||
data = self.opener.open(url).read()
|
data = self.opener.open(url).read()
|
||||||
|
|
||||||
lines = data.split('\n')
|
lines = data.split('\n')
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ def addFolderToZip(zippedHelp,folder,fpath):
|
||||||
|
|
||||||
folderFiles = os.listdir(fpath)
|
folderFiles = os.listdir(fpath)
|
||||||
for f in folderFiles:
|
for f in folderFiles:
|
||||||
print('------%s' % f)
|
|
||||||
if os.path.isfile(fpath + '/' + f):
|
if os.path.isfile(fpath + '/' + f):
|
||||||
print('basename=%s' % os.path.basename(fpath + '/' + f))
|
print('basename=%s' % os.path.basename(fpath + '/' + f))
|
||||||
zippedHelp.write(fpath + '/' + f, folder + '/' + f, zipfile.ZIP_DEFLATED)
|
zippedHelp.write(fpath + '/' + f, folder + '/' + f, zipfile.ZIP_DEFLATED)
|
||||||
|
|
@ -37,5 +36,4 @@ def addFolderToZip(zippedHelp,folder,fpath):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
toZip('sample.epub', "books/Harry's_Second_Chance:_Back_From_the_Future")
|
toZip('sample.epub', "books/Harry's_Second_Chance:_Back_From_the_Future")
|
||||||
z = zipfile.ZipFile('sample.epub', 'r')
|
z = zipfile.ZipFile('sample.epub', 'r')
|
||||||
print(z.namelist())
|
|
||||||
Loading…
Reference in a new issue