python-adfs

changeset 66:715522effc0b

Added placeholder arguments for future time stamp support.
author David Boddie <david@boddie.org.uk>
date Sat Jul 12 23:54:21 2008 +0200
parents 828d28f47e66
children 19d4af309d2d
files ADFSlib.py
diffstat 1 files changed, 17 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/ADFSlib.py	Sun Jun 08 21:46:34 2008 +0200
     1.2 +++ b/ADFSlib.py	Sat Jul 12 23:54:21 2008 +0200
     1.3 @@ -1477,7 +1477,7 @@
     1.4          return name
     1.5      
     1.6      def _extract_old_files(self, objects, path, filetypes = 0, separator = ",",
     1.7 -                           convert_dict = {}):
     1.8 +                           convert_dict = {}, with_time_stamps = False):
     1.9      
    1.10          new_path = self._create_directory(path)
    1.11          
    1.12 @@ -1545,7 +1545,7 @@
    1.13      
    1.14      
    1.15      def _extract_new_files(self, objects, path, filetypes = 0, separator = ",",
    1.16 -                           convert_dict = {}):
    1.17 +                           convert_dict = {}, with_time_stamps = False):
    1.18      
    1.19          new_path = self._create_directory(path)
    1.20          
    1.21 @@ -1614,10 +1614,12 @@
    1.22      
    1.23      
    1.24      def extract_files(self, out_path, files = None, filetypes = 0,
    1.25 -                      separator = ",", convert_dict = {}):
    1.26 +                      separator = ",", convert_dict = {},
    1.27 +                      with_time_stamps = False):
    1.28      
    1.29          """extract_files(self, out_path, files = None, filetypes = 0,
    1.30 -                         separator = ",", convert_dict = {})
    1.31 +                         separator = ",", convert_dict = {},
    1.32 +                         with_time_stamps = False)
    1.33          
    1.34          Extracts the files stored in the disc image into a directory structure
    1.35          stored on the path specified by out_path.
    1.36 @@ -1633,6 +1635,9 @@
    1.37          
    1.38          The convert_dict parameter can be used to specify a mapping between
    1.39          characters used in ADFS file names and those on the target file system.
    1.40 +        
    1.41 +        If with_time_stamps is set, each extracted file will be given the time
    1.42 +        stamp on the target file system that it has in the disc image.
    1.43          """
    1.44          
    1.45          if files is None:
    1.46 @@ -1642,25 +1647,29 @@
    1.47          if self.disc_type == 'adD':
    1.48          
    1.49              self._extract_old_files(
    1.50 -                files, out_path, filetypes, separator, convert_dict
    1.51 +                files, out_path, filetypes, separator, convert_dict,
    1.52 +                with_time_stamps
    1.53                  )
    1.54          
    1.55          elif self.disc_type == 'adE':
    1.56          
    1.57              self._extract_new_files(
    1.58 -                files, out_path, filetypes, separator, convert_dict
    1.59 +                files, out_path, filetypes, separator, convert_dict,
    1.60 +                with_time_stamps
    1.61                  )
    1.62          
    1.63          elif self.disc_type == 'adEbig':
    1.64          
    1.65              self._extract_new_files(
    1.66 -                files, out_path, filetypes, separator, convert_dict
    1.67 +                files, out_path, filetypes, separator, convert_dict,
    1.68 +                with_time_stamps
    1.69                  )
    1.70          
    1.71          else:
    1.72          
    1.73              self._extract_old_files(
    1.74 -                files, out_path, filetypes, separator, convert_dict
    1.75 +                files, out_path, filetypes, separator, convert_dict,
    1.76 +                with_time_stamps
    1.77                  )
    1.78      
    1.79      def _create_directory(self, path, name = None):