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:
+3
-3
@@ -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
@@ -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
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user