Package pyamf :: Module sol
[hide private]
[frames] | no frames]

Module sol

source code

Local Shared Object implementation.

Local Shared Object (LSO), sometimes known as Adobe Flash cookies, is a cookie-like data entity used by the Adobe Flash Player and Gnash. The players allow web content to read and write LSO data to the computer's local drive on a per-domain basis.


See Also: Local Shared Object on WikiPedia

Since: 0.1

Classes [hide private]
  SOL
Local Shared Object class, allows easy manipulation of the internals of a sol file.
  LSO
Local Shared Object class, allows easy manipulation of the internals of a sol file.
Functions [hide private]
 
decode(stream, strict=True)
Decodes a SOL stream.
source code
BufferedByteStream, a file like object.
encode(name, values, strict=True, encoding=0)
Produces a SharedObject encoded stream based on the name and values.
source code
 
load(name_or_file)
Loads a sol file and returns a SOL object.
source code
 
save(sol, name_or_file, encoding=0)
Writes a SOL object to name_or_file.
source code
Variables [hide private]
  HEADER_VERSION = '\x00\xbf'
  HEADER_SIGNATURE = 'TCSO\x00\x04\x00\x00\x00\x00'
  PADDING_BYTE = '\x00'
  __package__ = 'pyamf'

Imports: pyamf, util


Function Details [hide private]

decode(stream, strict=True)

source code 

Decodes a SOL stream. strict mode ensures that the sol stream is as spec compatible as possible.

Returns:
A tuple containing the root_name and a dict of name, value pairs.

encode(name, values, strict=True, encoding=0)

source code 

Produces a SharedObject encoded stream based on the name and values.

Parameters:
  • name - The root name of the SharedObject.
  • values - A `dict` of name value pairs to be encoded in the stream.
  • strict - Ensure that the SOL stream is as spec compatible as possible.
Returns: BufferedByteStream, a file like object.
A SharedObject encoded stream.

load(name_or_file)

source code 

Loads a sol file and returns a SOL object.

Parameters:
  • name_or_file (string) - Name of file, or file-object.

save(sol, name_or_file, encoding=0)

source code 

Writes a SOL object to name_or_file.

Parameters:
  • name_or_file - Name of file or file-object to write to.
  • encoding - AMF encoding type.