Package phones :: Module com_lgvx5200
[hide private]
[frames] | no frames]

Source Code for Module phones.com_lgvx5200

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2003-2005 Roger Binns <rogerb@rogerbinns.com> 
  4  ### Copyright (C) 2005 Simon Capper <skyjunky@sbcglobal.net> 
  5  ### 
  6  ### This program is free software; you can redistribute it and/or modify 
  7  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
  8  ### 
  9  ### $Id: com_lgvx5200.py 4303 2007-07-13 20:46:53Z djpham $ 
 10   
 11  """Communicate with the LG VX5200 cell phone 
 12   
 13   
 14  The code in this file mainly inherits from VX8100 code and then extends where 
 15  the 5200 has different functionality 
 16   
 17  """ 
 18   
 19  # standard modules 
 20  import time 
 21  import cStringIO 
 22  import sha 
 23   
 24  # my modules 
 25  import common 
 26  import commport 
 27  import copy 
 28  import com_lgvx4400 
 29  import p_brew 
 30  import p_lgvx5200 
 31  import com_lgvx8100 
 32  import com_brew 
 33  import com_phone 
 34  import com_lg 
 35  import prototypes 
 36  import bpcalendar 
 37  import call_history 
 38  import sms 
 39  import memo 
 40  import helpids 
 41   
42 -class Phone(com_lgvx8100.Phone):
43 "Talk to the LG VX5200 cell phone" 44 45 desc="LG-VX5200" 46 helpid=helpids.ID_PHONE_LGVX5200 47 protocolclass=p_lgvx5200 48 serialsname='lgvx5200' 49 50 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone') + \ 51 tuple(['Ringtone '+`n` for n in range(1,11)]) + \ 52 ('No Ring',) 53 54 ringtonelocations= ( 55 # type index-file size-file directory-to-use lowest-index-to-use maximum-entries type-major icon idx_offset 56 ( 'ringers', 'dload/ringtone.dat', '', 'user/sound/ringer', 100, 150, 0x201, 1, 0), 57 ( 'sounds', 'dload/sound.dat', 'dload/soundsize.dat', 'dload/snd', 100, 150, 0x402, 0, 151), 58 ) 59 60 calendarlocation="sch/schedule.dat" 61 calendarexceptionlocation="sch/schexception.dat" 62 calenderrequiresreboot=1 63 memolocation="sch/memo.dat" 64 65 builtinwallpapers = () # none 66 67 wallpaperlocations= ( 68 ( 'images', 'dload/image.dat', 'dload/imagesize.dat', 'dload/img', 100, 50, 0, 0, 0), 69 ) 70
71 - def __init__(self, logtarget, commport):
72 com_lgvx4400.Phone.__init__(self,logtarget,commport) 73 self.mode=self.MODENONE
74
75 - def __del__(self):
76 pass
77 78 my_model='VX5200' 79 80 # Media stuff--------------------------------------------------------------- 81 # Bypassing the 8100/9800 specific stuff
82 - def getmedia(self, maps, results, key):
83 return com_lg.LGNewIndexedMedia2.getmedia(self, maps, results, key)
84 - def savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction):
85 return com_lg.LGNewIndexedMedia2.savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction)
86 87 parentprofile=com_lgvx8100.Profile
88 -class Profile(parentprofile):
89 protocolclass=Phone.protocolclass 90 serialsname=Phone.serialsname 91 92 BP_Calendar_Version=3 93 phone_manufacturer='LG Electronics Inc' 94 phone_model='VX5200' 95 96 WALLPAPER_WIDTH=275 97 WALLPAPER_HEIGHT=175 98 MAX_WALLPAPER_BASENAME_LENGTH=32 99 WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ." 100 WALLPAPER_CONVERT_FORMAT="jpg" 101 102 # the 5200 uses "W" for wait in the dialstring, it does not support "T" 103 DIALSTRING_CHARS="[^0-9PW#*]" 104 105 MAX_RINGTONE_BASENAME_LENGTH=32 106 RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ." 107 108 # the 5200 doesn't have seperate origins - they are all dumped in "images" 109 imageorigins={} 110 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
111 - def GetImageOrigins(self):
112 return self.imageorigins
113 114 ringtoneorigins=('ringers', 'sounds') 115 excluded_ringtone_origins=('sounds') 116 117 # our targets are the same for all origins 118 imagetargets={} 119 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 120 {'width': 275, 'height': 175, 'format': "JPEG"})) 121
122 - def GetTargetsForImageOrigin(self, origin):
123 return self.imagetargets
124 125
126 - def __init__(self):
127 parentprofile.__init__(self)
128 129 _supportedsyncs=( 130 ('phonebook', 'read', None), # all phonebook reading 131 ('calendar', 'read', None), # all calendar reading 132 ('wallpaper', 'read', None), # all wallpaper reading 133 ('ringtone', 'read', None), # all ringtone reading 134 ('call_history', 'read', None),# all call history list reading 135 ('sms', 'read', None), # all SMS list reading 136 ('memo', 'read', None), # all memo list reading 137 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 138 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 139 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 140 ('wallpaper', 'write', 'OVERWRITE'), 141 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 142 ('ringtone', 'write', 'OVERWRITE'), 143 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 144 ('memo', 'write', 'OVERWRITE'), # all memo list writing 145 )
146