Pkg.DSStore — API for parsing Apple’s .DS_Store files

Overview

The Pkg.DSStore module contains the API for parsing Apple’s .DS_Store files.

Parsing a .DS_Store File

The following code example demonstrates how to parse a .DSStore file:

from Pro.Core import *
from Pkg.DSStore import *

def parseDSStore(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = DSStoreObject()
    if not obj.Load(c) or not obj.Parse():
        return
    for rec in obj.GetRecords():
        print(rec.filename, rec.id, rec.type, rec.value)

Module API

Pkg.DSStore module API.

Classes:

DSStoreObject()

This class represent a .DSStore file.

DSStoreRecord()

This class represents a single .DSStore record.

class DSStoreObject

Bases: Pro.Core.CFFObject

This class represent a .DSStore file.

Methods:

GetRecords()

Returns the list of records in the file.

Parse([wo])

Parses the format.

GetRecords()List[Pkg.DSStore.DSStoreRecord]
Returns

Returns the list of records in the file.

Return type

List[DSStoreRecord]

See also Parse().

Parse(wo: Optional[Pro.Core.NTIWait] = None)bool

Parses the format.

Parameters

wo (NTIWait) – An optional wait object for the parsing operation.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also GetRecords().

class DSStoreRecord

This class represents a single .DSStore record.

See also DSStoreObject.GetRecords().

Attributes:

filename

The file name.

id

The record id.

offset

The record offset.

size

The record size.

type

The record type.

value

The record value.

value_offset

The record value offset.

value_size

The record value size.

filename

The file name.

id

The record id.

offset

The record offset.

size

The record size.

type

The record type.

value

The record value.

value_offset

The record value offset.

value_size

The record value size.