Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/archive_util.html
Дата изменения: Fri Apr 8 12:46:14 2016
Дата индексирования: Mon Apr 11 02:08:24 2016
Кодировка:
Python: module archive_util
 
 
archive_util (version 4/4/13)
index
archive_util.py

PURPOSE --
A module for PASS archival related utilities.
 
DEVELOPER --
Greg Wenzel
 
MODIFICATION HISTORY --
 
o  initial implementation  GWW   11/20/03
o  add add_files function drc 3/5/12
o  avoid collisions with other processes by moving the archive file
   from a temporary location. drc 4/4/13

 
Modules
       
cPickle
configure_util
exceptions
fnmatch
glob
os
spss_sys_util
zipfile

 
Classes
       
exceptions.Exception(exceptions.BaseException)
ArchiveError
zipfile.ZipFile(__builtin__.object)
pass_archive

 
class ArchiveError(exceptions.Exception)
    
Method resolution order:
ArchiveError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class pass_archive(zipfile.ZipFile)
    a class for managing pass archive files
 
 
Method resolution order:
pass_archive
zipfile.ZipFile
__builtin__.object

Methods defined here:
add_files(self, file_list)
Adds files to the archive.
add_pickle(self, pickle_path)
adds a pickle and associated configured files to the archive
extract_archived_pickle(self, pickle_path, pickle_out_dir=None)
extracts an archived pickle and all associated configured data
get_list_of_pickle_paths(self, pickle_filter='*')
returns a list of zipped pickle paths
get_pickle_info(self, pickle_path)
returns the pickle info tuple from a zipped pickle
get_pickle_info_list(self, pickle_filter='*')
returns the pickle info list from zipped pickles matching pickle_filter
get_pickled_object(self, pickle_path)
returns a object from a zipped pickle
glob(self, glob_string)
performs a glob like function for files in the zip archive

Methods inherited from zipfile.ZipFile:
__del__(self)
Call the "close()" method in case the user forgot.
__enter__(self)
__exit__(self, type, value, traceback)
__init__(self, file, mode='r', compression=0, allowZip64=False)
Open the ZIP file with mode read "r", write "w" or append "a".
close(self)
Close the file, and for mode "w" and "a" write the ending
records.
extract(self, member, path=None, pwd=None)
Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a ZipInfo object. You can
specify a different directory using `path'.
extractall(self, path=None, members=None, pwd=None)
Extract all members from the archive to the current working
directory. `path' specifies a different directory to extract to.
`members' is optional and must be a subset of the list returned
by namelist().
getinfo(self, name)
Return the instance of ZipInfo given 'name'.
infolist(self)
Return a list of class ZipInfo instances for files in the
archive.
namelist(self)
Return a list of file names in the archive.
open(self, name, mode='r', pwd=None)
Return file-like object for 'name'.
printdir(self)
Print a table of contents for the zip file.
read(self, name, pwd=None)
Return file bytes (as a string) for name.
setpassword(self, pwd)
Set default password for encrypted files.
testzip(self)
Read all the files and check the CRC.
write(self, filename, arcname=None, compress_type=None)
Put the bytes from filename into the archive under the name
arcname.
writestr(self, zinfo_or_arcname, bytes, compress_type=None)
Write a file into the archive.  The contents is the string
'bytes'.  'zinfo_or_arcname' is either a ZipInfo instance or
the name of the file in the archive.

Data descriptors inherited from zipfile.ZipFile:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
comment
The comment text associated with the ZIP file.

Data and other attributes inherited from zipfile.ZipFile:
fp = None

 
Functions
       
archive_files(glob_string, archive_dir='/data/scheduling/spss_flight_data/pass/archive/add')
archives files to archive directory
archive_pickle(pickle_path, archive_dir='/data/scheduling/spss_flight_data/pass/archive')
archives pickle to archive directory

 
Data
        PASS_ARCHIVE_DIR = '/data/scheduling/spss_flight_data/pass/archive'
WORKING_DIR = '/data/scheduling/spss_flight_data/pass/archive/temp'
__version__ = '4/4/13'