Module ImportFrom alias alias alias alias alias alias ImportFrom alias alias alias alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias TryExcept body Import alias handlers ExceptHandler type NameLoad body Import alias identifier ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list Assign NameStore Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad Str NameLoad body Expr Str If CompareNotIn NameLoad TupleLoad Str Str Str body Raise Call NameLoad Str If BoolOpAnd CompareIn NameLoad TupleLoad Str Str UnaryOpNot NameLoad body Print BinOpMod Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareEq NameLoad Str UnaryOpNot Call NameLoad NameLoad body Raise NameLoad NameLoad TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Print BinOpMod Str NameLoad Print BinOpMod Str NameLoad Raise NameLoad NameLoad ExceptHandler type NameLoad name NameStore body Print Str Raise NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call Call NameLoad NameLoad AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Assign NameStore Num Assign TupleStore NameStore NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr BinOpMult Num Num While NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult Num Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareNotEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return TupleLoad NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad Str attr TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Return TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Return NameLoad orelse Return AttributeLoad Call NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str If BoolOpAnd CompareEq NameLoad NameLoad CompareNotEq NameLoad NameLoad body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr Str body Raise NameLoad Str orelse If Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call AttributeLoad Str attr NameLoad NameLoad orelse Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Dict NameLoad NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr Str body Raise NameLoad Str orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Str SubscriptLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr attr Str Index Num Assign SubscriptStore NameLoad Index Str NameLoad If BoolOpAnd Call AttributeLoad NameLoad attr NameLoad NameLoad CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Print Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad body Raise NameLoad BinOpMod Str NameLoad orelse Raise NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Return Dict ExceptHandler type NameLoad name NameStore body Raise NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad body Return SubscriptLoad NameLoad Index NameLoad orelse Return Dict orelse Raise NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Print BinOpMod Str NameLoad ExceptHandler type NameLoad name NameStore body Raise NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Dict Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Dict keyword NameLoad keyword NameLoad Return SubscriptLoad NameLoad Index NameLoad orelse Raise NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Raise NameLoad BinOpMod Str NameLoad ExceptHandler type NameLoad name NameStore body Raise NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad body For NameStore ListComp NameLoad comprehension NameStore NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body Delete SubscriptDel SubscriptLoad NameLoad Index NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Dict keyword NameLoad keyword NameLoad orelse Raise NameLoad Str decorator_list decorator_list
N/A ofs.local.zipfile ZipFile BadZipfile LargeZipFile ZIP_STORED ZIP_DEFLATED is_zipfile ofs.base BucketExists OFSException OFSInterface OFSFileNotFound pairtree ppath N/A hashlib datetime datetime tempfile mkstemp uuid uuid4 N/A os N/A N/A N/A json N/A N/A N/A ImportError N/A N/A simplejson json NoSuchZipArchive N/A OFSException N/A N/A N/A BadZipArchive N/A OFSException N/A N/A N/A N/A MD_FILE ZOFS_persistent_metadata.json ZOFS N/A OFSInterface N/A N/A Implementation of an OFS interface to a zip file archive.

    Metadata: This is stored in the metadata/ 'folder' - same filename as the
    original bucket it describes.
     __init__ N/A N/A self zipfile mode compression allowZip64 hashing_type quiet N/A r ZIP_STORED False md5 False N/A N/A Open the ZOFS ZIP file archive with mode read "r", write "w" or append "a". N/A N/A mode N/A r w a N/A N/A N/A RuntimeError ZOFS() requires mode "r", "w", or "a" (due to underlying ZipFile class) N/A N/A N/A mode N/A w a N/A quiet N/A N/A N/A IMPORTANT: You MUST .close() this ZOFS instance for it to write the ending records in '%s' mode. Otherwise the resultant zip archive will be unreadable. mode N/A N/A self zipfile zipfile N/A N/A self mode mode N/A N/A self compression compression N/A N/A self allowZip64 allowZip64 N/A N/A self hashing_type hashing_type N/A N/A self quiet quiet N/A N/A N/A mode r N/A N/A is_zipfile zipfile N/A N/A BadZipArchive e N/A N/A N/A N/A self z N/A ZipFile N/A self zipfile N/A self mode N/A self compression N/A self allowZip64 N/A N/A N/A BadZipfile N/A e N/A N/A N/A Couldn't open the zipfile at '%s' zipfile N/A N/A Got BadZipfile %s error e N/A BadZipArchive e N/A N/A LargeZipFile N/A e N/A N/A the zipfile requires ZIP64 extensions and those extensions are disabled. N/A BadZipArchive e N/A _write N/A N/A self z bucket label stream N/A N/A N/A name N/A N/A self _zf bucket label N/A N/A N/A self hashing_type None N/A N/A hash_gen N/A N/A getattr hashlib N/A self hashing_type N/A N/A hasattr stream read N/A N/A size 0 N/A N/A fd filename N/A mkstemp N/A f N/A N/A os fdopen fd wb N/A chunk N/A N/A stream read N/A 1024 128 N/A chunk N/A N/A N/A N/A f write chunk N/A size N/A size N/A len chunk N/A N/A N/A self hashing_type None N/A N/A N/A N/A hash_gen update chunk N/A chunk N/A N/A stream read N/A 1024 128 N/A N/A N/A f close N/A N/A N/A z write filename name N/A N/A N/A os remove filename N/A N/A N/A N/A self hashing_type None N/A N/A N/A N/A hash_gen update stream N/A size N/A len stream N/A N/A N/A z writestr name stream N/A N/A N/A self hashing_type None N/A N/A N/A size N/A %s:%s N/A N/A self hashing_type N/A N/A hash_gen hexdigest N/A N/A size N/A __del__ N/A N/A self N/A N/A N/A Unlikely that this will be called, but just in case N/A N/A N/A self close N/A close N/A N/A self N/A N/A N/A N/A N/A N/A self z close N/A _zf N/A N/A self bucket label N/A N/A N/A N/A N/A / join N/A N/A N/A ppath id_encode bucket label N/A _nf N/A N/A self name N/A N/A N/A N/A enc_bucket label N/A N/A name split / 1 N/A N/A N/A N/A ppath id_decode enc_bucket label N/A exists N/A N/A self bucket label N/A N/A N/A Whether a given bucket:label object already exists. N/A fn N/A N/A self _zf bucket label N/A N/A N/A N/A N/A N/A self z getinfo fn N/A True N/A N/A N/A KeyError N/A N/A False N/A claim_bucket N/A N/A self bucket N/A None N/A N/A Claim a bucket. -- This is a NOOP as the bucket is a virtual folder 
        in the zipfile and does not exist without files it 'contains'.
        
        Called without a 'bucket' it will respond with a uuid. N/A bucket N/A N/A bucket N/A N/A N/A N/A uuid4 hex N/A list_labels N/A N/A self bucket N/A N/A N/A List labels for the given bucket. Due to zipfiles inherent arbitrary ordering,
        this is an expensive operation, as it walks the entire archive searching for individual
        'buckets'

        :param bucket: bucket to list labels for.
        :return: iterator for the labels in the specified bucket.
         N/A name N/A N/A N/A self z namelist N/A N/A N/A container label N/A N/A self _nf N/A N/A name encode utf-8 N/A N/A N/A container bucket N/A label MD_FILE N/A N/A N/A label N/A list_buckets N/A N/A self N/A N/A N/A List all buckets managed by this OFS instance. Like list_labels, this also
        walks the entire archive, yielding the bucketnames. A local set is retained so that
        duplicates aren't returned so this will temporarily pull the entire list into memory
        even though this is a generator and will slow as more buckets are added to the set.
        
        :return: iterator for the buckets.
         N/A buckets N/A set N/A name N/A N/A N/A self z namelist N/A N/A N/A bucket _ N/A N/A self _nf name N/A N/A bucket buckets N/A N/A N/A N/A buckets add bucket N/A N/A bucket N/A get_stream N/A N/A self bucket label as_stream N/A True N/A N/A Get a bitstream for the given bucket:label combination.

        :param bucket: the bucket to use.
        :return: bitstream as a file-like object 
         N/A N/A N/A self mode w N/A N/A OFSException Cannot read from archive in 'w' mode N/A N/A N/A N/A self exists bucket label N/A N/A fn N/A N/A self _zf bucket label N/A as_stream N/A N/A N/A N/A N/A self z open fn N/A N/A N/A N/A N/A self z read fn N/A N/A OFSFileNotFound N/A get_url N/A N/A self bucket label N/A N/A N/A Get a URL that should point at the bucket:labelled resource. Aimed to aid web apps by allowing them to redirect to an open resource, rather than proxy the bitstream.

        :param bucket: the bucket to use.
        :param label: the label of the resource to get
        :return: a string URI - eg 'zip:file:///home/.../foo.zip!/bucket/label' 
         N/A N/A N/A self exists bucket label N/A N/A root N/A zip:file//%s N/A N/A N/A os path abspath N/A self zipfile N/A fn N/A N/A self _zf bucket label N/A N/A N/A !/ join root fn N/A N/A OFSFileNotFound N/A put_stream N/A N/A self bucket label stream_object params replace add_md N/A N/A True True N/A N/A Put a bitstream (stream_object) for the specified bucket:label identifier.

        :param bucket: as standard
        :param label: as standard
        :param stream_object: file-like object to read from or bytestring.
        :param params: update metadata with these params (see `update_metadata`)
         N/A N/A N/A self mode r N/A N/A OFSException Cannot write into archive in 'r' mode N/A N/A fn N/A N/A self _zf bucket label N/A N/A params N/A _creation_date N/A N/A N/A N/A N/A N/A N/A datetime now isoformat split . N/A 0 N/A N/A params N/A _label label N/A N/A N/A N/A self exists bucket label N/A replace True N/A N/A zinfo N/A N/A N/A self z getinfo fn N/A N/A size chksum N/A N/A self _write N/A self z bucket label stream_object N/A N/A N/A self _del_stream zinfo N/A N/A params N/A _content_length size N/A chksum N/A N/A N/A params N/A _checksum chksum N/A N/A N/A size chksum N/A N/A self _write N/A self z bucket label stream_object N/A N/A params N/A _content_length size N/A chksum N/A N/A N/A params N/A _checksum chksum N/A add_md N/A N/A params N/A N/A self update_metadata bucket label params N/A params N/A _del_stream N/A N/A self zinfo N/A N/A N/A DELETE DISABLED... until I can get it working... N/A N/A del_stream N/A N/A self bucket label N/A N/A N/A Delete a bitstream. This needs more testing - file deletion in a zipfile
        is problematic. Alternate method is to create second zipfile without the files
        in question, which is not a nice method for large zip archives.
         N/A N/A N/A self exists bucket label N/A N/A name N/A N/A self _zf bucket label N/A N/A N/A self _del_stream name N/A _get_bucket_md N/A N/A self bucket N/A N/A N/A name N/A N/A self _zf bucket MD_FILE N/A N/A N/A N/A self exists bucket MD_FILE N/A N/A OFSFileNotFound N/A N/A N/A self mode w N/A N/A json_doc N/A N/A N/A self z read name N/A N/A N/A jsn N/A N/A json loads json_doc N/A jsn N/A N/A N/A ValueError N/A N/A OFSException N/A Cannot read metadata for %s bucket N/A N/A OFSException Cannot read from archive in 'w' mode N/A get_metadata N/A N/A self bucket label N/A N/A N/A Get the metadata for this bucket:label identifier.
         N/A N/A N/A self mode w N/A N/A N/A N/A jsn N/A N/A self _get_bucket_md bucket N/A N/A N/A OFSFileNotFound N/A N/A N/A N/A N/A OFSException N/A e N/A N/A OFSException e N/A N/A N/A jsn has_key label N/A N/A N/A jsn N/A label N/A N/A N/A N/A N/A OFSException Cannot read md from archive in 'w' mode N/A update_metadata N/A N/A self bucket label params N/A N/A N/A Update the metadata with the provided dictionary of params.

        :param parmams: dictionary of key values (json serializable).
         N/A N/A N/A self mode r N/A N/A N/A N/A payload N/A N/A self _get_bucket_md bucket N/A N/A N/A OFSFileNotFound N/A N/A payload N/A N/A l N/A N/A self list_labels bucket N/A N/A N/A payload N/A l N/A N/A N/A N/A payload N/A l N/A _label l N/A N/A N/A self quiet N/A N/A N/A Had to create md file for %s bucket N/A N/A OFSException N/A e N/A N/A OFSException e N/A N/A N/A N/A payload has_key label N/A N/A N/A payload N/A label N/A N/A N/A N/A N/A payload N/A label update params N/A N/A N/A self put_stream bucket MD_FILE N/A N/A json dumps payload params N/A replace True add_md False N/A N/A payload N/A label N/A N/A OFSException Cannot update MD in archive in 'r' mode N/A del_metadata_keys N/A N/A self bucket label keys N/A N/A N/A Delete the metadata corresponding to the specified keys.
         N/A N/A N/A self mode r N/A N/A N/A N/A payload N/A N/A self _get_bucket_md bucket N/A N/A N/A OFSFileNotFound N/A N/A OFSFileNotFound N/A Couldn't find a md file for %s bucket bucket N/A N/A OFSException N/A e N/A N/A OFSException e N/A N/A N/A payload has_key label N/A N/A key N/A x N/A x keys N/A N/A N/A payload N/A label has_key x N/A N/A N/A N/A payload N/A label N/A key N/A N/A N/A self put_stream bucket MD_FILE N/A N/A json dumps payload params N/A replace True add_md False N/A N/A OFSException Cannot update MD in archive in 'r' mode N/A N/A