Package gen :: Package lib :: Module mediabase :: Class MediaBase
[frames] | no frames]

Class MediaBase

source code


Base class for storing media references.

Instance Methods
 
__init__(self, source=None)
Create a new MediaBase, copying from source if not None.
source code
 
serialize(self)
Convert the object to a serialized tuple of data.
source code
 
unserialize(self, data)
Convert a serialized tuple of data to an object.
source code
 
add_media_reference(self, media_ref)
Add a MediaRef instance to the object's media list.
source code
list
get_media_list(self)
Return the list of MediaRef instances associated with the object.
source code
 
set_media_list(self, media_ref_list)
Set the list of MediaRef instances associated with the object.
source code
bool
has_media_reference(self, obj_handle)
Return True if the object or any of it's child objects has reference to this media object handle.
source code
 
remove_media_references(self, obj_handle_list)
Remove references to all media handles in the list.
source code
 
replace_media_references(self, old_handle, new_handle)
Replace all references to old media handle with the new handle.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Create a new MediaBase, copying from source if not None.

Parameters:
  • source (MediaBase) - Object used to initialize the new object

add_media_reference(self, media_ref)

source code 

Add a MediaRef instance to the object's media list.

Parameters:
  • media_ref (MediaRef) - MediaRef instance to be added to the object's media list.

get_media_list(self)

source code 

Return the list of MediaRef instances associated with the object.

Returns: list
list of MediaRef instances associated with the object

set_media_list(self, media_ref_list)

source code 

Set the list of MediaRef instances associated with the object. It replaces the previous list.

Parameters:
  • media_ref_list (list) - list of MediaRef instances to be assigned to the object.

has_media_reference(self, obj_handle)

source code 

Return True if the object or any of it's child objects has reference to this media object handle.

Parameters:
  • obj_handle (str) - The media handle to be checked.
Returns: bool
Returns whether the object or any of it's child objects has reference to this media handle.

remove_media_references(self, obj_handle_list)

source code 

Remove references to all media handles in the list.

Parameters:
  • obj_handle_list (list) - The list of media handles to be removed.

replace_media_references(self, old_handle, new_handle)

source code 

Replace all references to old media handle with the new handle.

Parameters:
  • old_handle (str) - The media handle to be replaced.
  • new_handle (str) - The media handle to replace the old one with.