add_file yeterince açıklayıcı bir isim değildi. Artık ne kadar açıklayıcı, değil mi?

This commit is contained in:
Barış Metin
2005-06-24 09:07:33 +00:00
parent 63f6c5ee2b
commit d216a61504
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
# Archive module provides access to regular archive file types.
# maintainer baris and meren
#standart lisbrary modules
#standard lisbrary modules
import os
import sys
import tarfile
@@ -73,12 +73,12 @@ class ArchiveZip(ArchiveBase):
"""Close the zip archive."""
self.zip.close()
def add_file(self, fileName):
def add_to_archive(self, fileName):
"""Add file or directory to a zip file"""
if os.path.isdir(fileName) and not os.path.islink(fileName):
self.zip.writestr(fileName + '/', '')
for f in os.listdir(fileName):
self.add_file(fileName + '/' + f)
self.add_to_archive(fileName + '/' + f)
else:
if os.path.islink(fileName):
dest = os.readlink(fileName)
+3 -3
View File
@@ -200,8 +200,8 @@ class PisiBuild:
c = os.getcwd()
os.chdir(self.ctx.pkg_dir())
pkg.add_file(const.metadata_xml)
pkg.add_file(const.files_xml)
pkg.add_file("install")
pkg.add_to_package(const.metadata_xml)
pkg.add_to_package(const.files_xml)
pkg.add_to_package("install")
pkg.close()
os.chdir(c)
+2 -2
View File
@@ -13,9 +13,9 @@ class Package:
self.impl = archive.ArchiveZip(packagefn, 'zip', mode)
self.filename = packagefn
def add_file(self, fn):
def add_to_package(self, fn):
"""Add a file or directory to package"""
self.impl.add_file(fn)
self.impl.add_to_archive(fn)
def close(self):
"""Close the package archive"""