import shutil
import tempfile
import subprocess
+from mic import msger
__all__ = [
"get_compress_formats",
shell = False
else:
shell = True
+ msger.info("Running command: " + " ".join(cmdln_or_args))
proc = subprocess.Popen(cmdln_or_args, shell=shell,
stdout=subprocess.PIPE,
cmdln = ["tar", "-S", "-C", target_dir, "-cf", archive_name, target_name]
+
_call_external(cmdln)
return archive_name
@retval: the path of the archived file
"""
import tarfile
+
+ msger.info("Taring files to %s using tarfile module" % archive_name)
tar = tarfile.open(archive_name, 'w')
if os.path.isdir(target_name):
for child in os.listdir(target_name):
"""
import zipfile
+ msger.info("Zipping files to %s using zipfile module" % archive_name)
arv = zipfile.ZipFile(archive_name, 'w', compression=zipfile.ZIP_DEFLATED)
if os.path.isdir(target_name):