small changes to make work on other machines. why there's no Python 2.6 on Ubuntu?

This commit is contained in:
sigizmund 2009-12-17 12:53:59 +00:00
parent 6e73e5dc11
commit d2d183430d
2 changed files with 2 additions and 3 deletions

1
ffa.py
View file

@ -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')

View file

@ -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)
@ -38,4 +37,3 @@ 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())