applesingle
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/applesingle.py
Module Docs

Routines to decode AppleSingle files

 
Modules
       
Carbon
MacOS
struct
sys

 
Classes
       
__builtin__.object
AppleSingle
exceptions.ValueError(exceptions.StandardError)
Error

 
class AppleSingle(__builtin__.object)
     Methods defined here:
__init__(self, fileobj, verbose=False)
tofile(self, path, resonly=False)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
datafork = None
resourcefork = None

 
class Error(exceptions.ValueError)
    # all of the errors in this module are really errors in the input
# so I think it should test positive against ValueError.
 
 
Method resolution order:
Error
exceptions.ValueError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

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

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

Data and other attributes inherited from exceptions.ValueError:
__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

 
Functions
       
decode(infile, outpath, resonly=False, verbose=False)
decode(infile, outpath [, resonly=False, verbose=False])
 
Creates a decoded file from an AppleSingle encoded file.
If resonly is True, then it will create a regular file at
outpath containing only the resource fork from infile.
Otherwise it will create an AppleDouble file at outpath
with the data and resource forks from infile.  On platforms
without the MacOS module, it will create inpath and inpath+'.rsrc'
with the data and resource forks respectively.

 
Data
        AS_DATAFORK = 1
AS_ENTRY_FORMAT = '>lll'
AS_ENTRY_LENGTH = 12
AS_HEADER_FORMAT = '>LL16sh'
AS_HEADER_LENGTH = 26
AS_IGNORE = (3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15)
AS_MAGIC = 333312
AS_RESOURCEFORK = 2
AS_VERSION = 131072