/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
DybPython::tar::TarFileWrapper Class Reference

List of all members.

Public Member Functions

def __init__
def extractall

Public Attributes

 tf

Detailed Description

Extractall only appears in 2.7 so back port from there into this wrapper from use from 2.3. 2.4, 2.5, 2.6  

Definition at line 459 of file tar.py.


Constructor & Destructor Documentation

def DybPython::tar::TarFileWrapper::__init__ (   self,
  tf 
)

Definition at line 463 of file tar.py.

00464                           :
00465         self.tf = tf


Member Function Documentation

def DybPython::tar::TarFileWrapper::extractall (   self,
  path = ".",
  members = None 
)
Extract all members from the archive to the current working
   directory and set owner, modification time and permissions on
   directories afterwards. `path' specifies a different directory
   to extract to. `members' is optional and must be a subset of the
   list returned by getmembers().

Definition at line 466 of file tar.py.

00467                                                 :
00468         """Extract all members from the archive to the current working
00469            directory and set owner, modification time and permissions on
00470            directories afterwards. `path' specifies a different directory
00471            to extract to. `members' is optional and must be a subset of the
00472            list returned by getmembers().
00473         """
00474         directories = []
00475 
00476         if members is None:
00477             members = self.tf
00478 
00479         for tarinfo in members:
00480             if tarinfo.isdir():
00481                 # Extract directories with a safe mode.
00482                 directories.append(tarinfo)
00483                 tarinfo = copy.copy(tarinfo)
00484                 tarinfo.mode = 0700
00485             self.tf.extract(tarinfo, path)
00486 
00487         # Reverse sort directories.
00488         directories.sort(lambda a, b: cmp(a.name, b.name))
00489         directories.reverse()
00490 
00491         # Set correct owner, mtime and filemode on directories.
00492         for tarinfo in directories:
00493             dirpath = os.path.join(path, tarinfo.name)
00494             try:
00495                 self.tf.chown(tarinfo, dirpath)
00496                 self.tf.utime(tarinfo, dirpath)
00497                 self.tf.chmod(tarinfo, dirpath)
00498             except ExtractError, e:
00499                 if self.tf.errorlevel > 1:
00500                     raise
00501                 else:
00502                     self.tf._dbg(1, "tarfile: %s" % e)
00503 


Member Data Documentation

Definition at line 463 of file tar.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4