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

Package util

source code

AMF Utilities.


Authors:
Arnar Birgisson, Thijs Triemstra, Nick Joyce

Since: 0.1.0

Submodules [hide private]

Classes [hide private]
  StringIOProxy
I am a StringIO type object containing byte data from the AMF stream.
  DataTypeMixIn
Provides methods for reading and writing basic data types for file-like objects.
  BufferedByteStream
An extension of StringIO.
  NetworkIOMixIn
Functions [hide private]
str
hexdump(data)
Get hexadecimal representation of StringIO data.
source code
str
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
 
make_classic_instance(klass)
Create an instance of a classic class (not inherited from ``object``) without calling __init__().
source code
 
get_mro(C)
Compute the class precedence list (mro)
source code
 
get_attrs(obj)
Gets a dict of the attrs of an object in a predefined resolution order
source code
 
get_instance_attrs(obj, alias) source code
 
read_double_workaround(self)
Reads an 8 byte float from the stream.
source code
 
write_double_workaround(self, d)
Writes an 8 byte float to the stream.
source code
 
x(self, d)
Writes an 8 byte float to the stream.
source code

Imports: struct, calendar, datetime, types, sys, StringIO, ET, fpconst, imports


Function Details [hide private]

hexdump(data)

source code 

Get hexadecimal representation of StringIO data.

Parameters:
  • data ()
Returns: str
Hexadecimal string.

get_timestamp(d)

source code 

Returns a UTC timestamp for a datetime.datetime object.

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

Note: 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.

make_classic_instance(klass)

source code 

Create an instance of a classic class (not inherited from ``object``) without calling __init__().

Parameters:
  • klass (class) - The classic class to create an instance for.
Returns:
instance created