Package phones :: Module com_lg :: Class LGDirectoryMedia
[hide private]
[frames] | no frames]

Class LGDirectoryMedia

source code

Known Subclasses:

The media is stored one per directory with .desc and body files

Instance Methods [hide private]
 
__init__(self) source code
 
getmediaindex(self, builtins, maps, results, key)
Gets the media (wallpaper/ringtone) index
source code
 
_createnamewithmimetype(self, name, mt) source code
 
_getmimetype(self, name) source code
 
getindex(self, location, getmedia=False)
Returns an index based on the sub-directories of location.
source code
 
getmedia(self, maps, result, key)
Returns the contents of media as a dict where the key is a name as returned by getindex, and the value is the contents of the media
source code
 
savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction)
Actually saves out the media
source code
Class Variables [hide private]
  __mimetoextensionmapping = {'audio/mid': '.mid', 'audio/mp3': ...
Method Details [hide private]

getmediaindex(self, builtins, maps, results, key)

source code 

Gets the media (wallpaper/ringtone) index

Parameters:
  • builtins - the builtin list on the phone
  • results - places results in this dict
  • maps - the list of index files and locations
  • key - key to place results in

getindex(self, location, getmedia=False)

source code 

Returns an index based on the sub-directories of location. The key is an integer, and the value is the corresponding name

savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction)

source code 

Actually saves out the media

Parameters:
  • mediakey - key of the media (eg 'wallpapers' or 'ringtones')
  • mediaindexkey - index key (eg 'wallpaper-index')
  • maps - list index files and locations
  • results - results dict
  • merge - are we merging or overwriting what is there?
  • reindexfunction - the media is re-indexed at the end. this function is called to do it

Class Variable Details [hide private]

__mimetoextensionmapping

Value:
{'audio/mid': '.mid',
 'audio/mp3': '.mp3',
 'audio/qcp': '.qcp',
 'image/bci': '.bci',
 'image/bmp': '.bmp',
 'image/gif': '.gif',
 'image/jpg': '.jpg',
 'image/png': '.png'}