Package pyamf :: Package util
[hide private]
[frames] | no frames]

Package util

source code

AMF Utilities.


Since: 0.1.0

Submodules [hide private]

Functions [hide private]
float
get_timestamp(d)
Returns a UTC timestamp for a datetime.datetime object.
source code
datetime.datetime
get_datetime(secs)
Return a UTC date from a timestamp.
source code
 
get_properties(obj)
Returns a list of properties for obj
source code
 
set_attrs(obj, attrs)
Applies a collection of attributes attrs to object obj in the most generic way possible.
source code
 
get_class_alias(klass)
Tries to find a suitable pyamf.ClassAlias subclass for klass.
source code
bool
is_class_sealed(klass)
Whether or not the supplied class can accept dynamic properties.
source code
dict
get_class_meta(klass)
Returns a dict containing meta data based on the supplied class, useful for class aliasing.
source code
 
get_module(mod_name)
Load and return a module based on mod_name.
source code
Variables [hide private]
  negative_timestamp_broken = False
  __package__ = 'pyamf.util'

Imports: calendar, datetime, inspect, pyamf, python, BufferedByteStream, imports


Function Details [hide private]

get_timestamp(d)

source code 

Returns a UTC timestamp for a datetime.datetime object.

Parameters:
  • d (datetime.datetime)
Returns: float
UTC timestamp.

See Also: Inspiration taken from the Intertwingly blog.

get_datetime(secs)

source code 

Return a UTC date from a timestamp.

Parameters:
  • secs (long) - Seconds since 1970.
Returns: datetime.datetime
UTC timestamp.

get_properties(obj)

source code 

Returns a list of properties for obj

Since: 0.5

set_attrs(obj, attrs)

source code 

Applies a collection of attributes attrs to object obj in the most generic way possible.

Parameters:
  • obj - An instance implementing __setattr__, or __setitem__
  • attrs (Usually a dict) - A collection implementing the iteritems function

is_class_sealed(klass)

source code 

Whether or not the supplied class can accept dynamic properties.

Returns: bool

Since: 0.5

get_class_meta(klass)

source code 

Returns a dict containing meta data based on the supplied class, useful for class aliasing.

Returns: dict

Since: 0.5