Changeset 7024 for branches/numpy/anuga


Ignore:
Timestamp:
May 13, 2009, 2:23:47 PM (16 years ago)
Author:
rwilson
Message:

Made 'tar a file' function more general.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/utilities/system_tools.py

    r6913 r7024  
    520520# @param files A list of files (or directories) to tar.
    521521# @param tarfile The created tarfile name.
     522# @note 'files' may be a string (single file) or a list of strings.
    522523# @note We use gzip compression.
    523524def tar_file(files, tarname):
    524525    '''Compress a file or directory into a tar file.'''
     526
     527    if isinstance(files, basestring):
     528        files = [files]
    525529
    526530    o = tarfile.open(tarname, 'w:gz')
Note: See TracChangeset for help on using the changeset viewer.