Package phones :: Module com_lgpm225 :: Class Phone
[hide private]
[frames] | no frames]

Class Phone

source code

               object --+        
                        |        
          com_phone.Phone --+    
                            |    
com_brew.RealBrewProtocol --+    
                            |    
       com_lg.LGPhonebook --+    
                            |    
    com_lg.LGIndexedMedia --+    
                            |    
           com_lgvx4400.Phone --+
                                |
                               Phone
Known Subclasses:

Talk to the LG PM225 cell phone

Nested Classes [hide private]

Inherited from com_brew.RealBrewProtocol: DirCache

Instance Methods [hide private]
 
__init__(self, logtarget, commport)
Calls all the constructors and sets initial modes
source code
 
getfundamentals(self, results)
Gets information fundamental to interoperating with the phone and UI.
source code
 
syncbegin(self) source code
 
syncend(self) source code
 
getphonebook(self, result)
Reads the phonebook data.
source code
 
get_phonebook_media(self, pbook, fundamentals)
This phone does not provide ringtone and image info for contacts in the regular packets so we have to read the filesystem directly
source code
 
extractphonebookentry(self, entry, fundamentals)
Return a phonebook entry in BitPim format.
source code
 
makeentry(self, counter, entry, data)
Creates pbentry object
source code
 
save_phonebook_media(self, pb_entries)
This phone does not provide ringtone and image info for contacts in the regular packets so we have to write the filesystem directly
source code
 
savegroups(self, data) source code
 
savephonebook(self, data)
Saves out the phonebook
source code
 
_readsms(self) source code
 
_setquicktext(self, result) source code
 
_getquicktext(self) source code
 
_getinboxmessage(self, sf) source code
 
_getoutboxmessage(self, sf) source code
 
getwallpaperindices(self, results) source code
 
getringtoneindices(self, results) source code
 
getwallpapers(self, result) source code
 
getringtones(self, result) source code
 
savewallpapers(self, results, merge) source code
 
saveringtones(self, results, merge) source code
 
getindex(self, indexfile)
Read an index file
source code
 
get_content_file(self, key) 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
 
getmediaindex(self, builtins, maps, results, key)
Gets the media (wallpaper/ringtone) index
source code
 
savemedia(self, mediakey, mediaindexkey, results, merge, reindexfunction)
Actually saves out the media
source code
 
make_new_media_entry(self, entry, index, type) source code
 
makegcd(self, filename, size)
Build a GCD file for filename
source code
 
makejad(self, filename, size)
Build a JAD file for filename
source code
 
getphoneinfo(self, phone_info) source code

Inherited from com_lgvx4400.Phone: eval_detect_data, get_cal, get_detect_data, get_esn, getcalendar, getcallhistory, getgroups, getmemo, getsms, is_mode_brew, savecalendar, savememo, savesms, set_cal

Inherited from com_phone.Phone: alert, close, log, logdata, progress, raisecommsdnaexception, raisecommsexception, readobject, setmode, writeobject

Inherited from com_phone.Phone (private): _setmodemodem

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Inherited from com_brew.RealBrewProtocol: basename, dirname, exists, explore0c, get_brew_esn, getfilecontents, getfilesystem, getfirmwareinformation, hassubdirs, isdir, isfile, join, listfiles, listsubdirs, mkdir, mkdirs, modemmoderequest, offlinerequest, rmdir, rmdirs, rmfile, sendbrewcommand, setfileattr, statfile, writefile

Inherited from com_brew.RealBrewProtocol (private): _setmodebrew

Inherited from com_lg.LGPhonebook: sendpbcommand

Class Methods [hide private]

Inherited from com_lgvx4400.Phone: detectphone

Class Variables [hide private]
  desc = 'LG PM225'
  helpid = 'phone-lgpm225.htm'
  protocolclass
Various descriptions of data specific to LG PM225 (Sprint)
  serialsname = 'lgpm225'
  imagelocations = ((1536, 'setas/dcamIndex.map', 'Dcam/Wallet',...
  ringtonelocations = ((4352, 'setas/voicememoRingerIndex.map', ...
  builtinimages = ('Spectrum', 'Speed', 'Drops', 'Country Road',...
  builtinringtones = ('Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'T...
  __mimetype = {'bmp': 'image/bmp', 'gif': 'image/gif', 'jar': '...
  __reverse_mimetype = {'application/java-archive': 'jar', 'audi...
  __app_extensions = {'jar': ''}
  brew_version_file = 'ams/version.txt'
  brew_version_txt_key = 'ams_version.txt'
  my_model = 'PM225'

Inherited from com_lgvx4400.Phone: esn_file, esn_file_key, lgpbinfo_key, ringerindexfilename, wallpaperindexfilename

Inherited from com_phone.Phone: MODEMODEM, MODENONE, getplaylist, gett9db, gettodo

Inherited from com_brew.RealBrewProtocol: MODEBREW, brewterminator

Inherited from com_brew.RealBrewProtocol (private): _brewepochtounix

Inherited from com_lg.LGPhonebook: MODEPHONEBOOK, pbterminator

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, logtarget, commport)
(Constructor)

source code 

Calls all the constructors and sets initial modes

Overrides: com_lg.LGIndexedMedia.__init__

getfundamentals(self, results)

source code 

Gets information fundamental to interoperating with the phone and UI.

Currently this is:

  • 'uniqueserial' a unique serial number representing the phone
  • 'groups' the phonebook groups

This method is called before we read the phonebook data or before we write phonebook data.

Overrides: com_lgvx4400.Phone.getfundamentals

getphonebook(self, result)

source code 

Reads the phonebook data. The getfundamentals information will already be in result.

Overrides: com_lgvx4400.Phone.getphonebook

extractphonebookentry(self, entry, fundamentals)

source code 

Return a phonebook entry in BitPim format. This is called from getphonebook.

Overrides: com_lgvx4400.Phone.extractphonebookentry

makeentry(self, counter, entry, data)

source code 

Creates pbentry object

Parameters:
  • counter - The new entry number
  • entry - The phonebook object (as returned from convertphonebooktophone) that we are using as the source
  • data - The main dictionary, which we use to get access to media indices amongst other things
Overrides: com_lgvx4400.Phone.makeentry

savegroups(self, data)

source code 
Overrides: com_lgvx4400.Phone.savegroups

savephonebook(self, data)

source code 

Saves out the phonebook

Overrides: com_lgvx4400.Phone.savephonebook

_readsms(self)

source code 
Overrides: com_lgvx4400.Phone._readsms

_setquicktext(self, result)

source code 
Overrides: com_lgvx4400.Phone._setquicktext

_getquicktext(self)

source code 
Overrides: com_lgvx4400.Phone._getquicktext

_getinboxmessage(self, sf)

source code 
Overrides: com_lgvx4400.Phone._getinboxmessage

_getoutboxmessage(self, sf)

source code 
Overrides: com_lgvx4400.Phone._getoutboxmessage

getwallpaperindices(self, results)

source code 
Overrides: com_lgvx4400.Phone.getwallpaperindices

getringtoneindices(self, results)

source code 
Overrides: com_lgvx4400.Phone.getringtoneindices

getwallpapers(self, result)

source code 
Overrides: com_lg.LGIndexedMedia.getwallpapers

getringtones(self, result)

source code 
Overrides: com_lg.LGIndexedMedia.getringtones

savewallpapers(self, results, merge)

source code 
Overrides: com_lg.LGIndexedMedia.savewallpapers

saveringtones(self, results, merge)

source code 
Overrides: com_lg.LGIndexedMedia.saveringtones

getindex(self, indexfile)

source code 

Read an index file

Overrides: com_lg.LGIndexedMedia.getindex

getmedia(self, maps, result, key)

source code 

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

Overrides: com_lg.LGIndexedMedia.getmedia

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
Overrides: com_lg.LGIndexedMedia.getmediaindex

savemedia(self, mediakey, mediaindexkey, 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
Overrides: com_lg.LGIndexedMedia.savemedia

Class Variable Details [hide private]

protocolclass

Various descriptions of data specific to LG PM225 (Sprint)

Value:
phones.p_lgpm225

imagelocations

Value:
((1536, 'setas/dcamIndex.map', 'Dcam/Wallet', 'camera', 50, 6))

ringtonelocations

Value:
((4352,
  'setas/voicememoRingerIndex.map',
  'VoiceDB/All/Memos',
  'voice_memo',
  50,
  11))

builtinimages

Value:
('Spectrum',
 'Speed',
 'Drops',
 'Country Road',
 'Houses',
 'Tulip',
 'Flower',
 'Lines',
...

builtinringtones

Value:
('Tone 1',
 'Tone 2',
 'Tone 3',
 'Tone 4',
 'Tone 5',
 'Tone 6',
 'Alert 1',
 'Alert 2',
...

__mimetype

Value:
{'bmp': 'image/bmp',
 'gif': 'image/gif',
 'jar': 'application/java-archive',
 'jpeg': 'image/jpeg',
 'jpg': 'image/jpg',
 'mid': 'audio/midi',
 'mp3': 'audio/vnd.qcelp',
 'png': 'image/png',
...

__reverse_mimetype

Value:
{'application/java-archive': 'jar',
 'audio/midi': 'mid',
 'audio/mp3': 'mp3',
 'audio/vnd.qcelp': 'mp3',
 'image/bmp': 'bmp',
 'image/gif': 'gif',
 'image/jpeg': 'jpeg',
 'image/jpg': 'jpg',
...