Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(31)  |  Call(19)  |  Derive(3)  |  Import(9)
Creates an archive from the list of given paths.
Returns the path of the created archive.

        def archive(paths):
    """Creates an archive from the list of given paths.
    Returns the path of the created archive.
    """

    filename = generate_filename()

    tmp = tempfile.mktemp(prefix='dirsnap-', suffix=('-' + filename))

    with tarfile.open(tmp, 'w:gz') as tar:
        for path in paths:
            tar.add(path)

    return tmp
        


src/d/i/dirsnap-0.0.3/dirsnap/cli.py   dirsnap(Download)
from clint import args
 
from .archive import archive
from .gist import upload
 
    # Create temp archive.
    print >> sys.stderr, 'Creating snapshot...'
    path = archive(paths)
 
    # Upload temp archive to service.