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

Source Code for Module phones.com_lgvx7000

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2003-2005 Roger Binns <rogerb@rogerbinns.com> 
  4  ### 
  5  ### This program is free software; you can redistribute it and/or modify 
  6  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
  7  ### 
  8  ### $Id: com_lgvx7000.py 3918 2007-01-19 05:15:12Z djpham $ 
  9   
 10  """Communicate with the LG VX7000 cell phone 
 11   
 12  The VX7000 is substantially similar to the VX6000 but also supports video. 
 13   
 14  The code in this file mainly inherits from VX4400 code and then extends where 
 15  the 6000 has extra 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 copy 
 27  import p_lgvx7000 
 28  import com_lgvx4400 
 29  import com_brew 
 30  import com_phone 
 31  import com_lg 
 32  import prototypes 
 33  import helpids 
 34   
35 -class Phone(com_lg.LGNewIndexedMedia,com_lgvx4400.Phone):
36 "Talk to the LG VX7000 cell phone" 37 38 desc="LG-VX7000" 39 helpid=helpids.ID_PHONE_LGVX7000 40 protocolclass=p_lgvx7000 41 serialsname='lgvx7000' 42 43 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps') + \ 44 tuple(['Ringtone '+`n` for n in range(1,11)]) + \ 45 ('No Ring',) 46 47 ringtonelocations= ( 48 # type index-file size-file directory-to-use lowest-index-to-use maximum-entries type-major 49 ( 'ringers', 'dload/sound.dat', 'dload/soundsize.dat', 'dload/snd', 100, 50, 1), 50 ) 51 52 builtinwallpapers = () # none 53 54 wallpaperlocations= ( 55 ( 'images', 'dload/image.dat', 'dload/imagesize.dat', 'dload/img', 100, 50, 0), 56 ) 57 58
59 - def __init__(self, logtarget, commport):
60 com_lgvx4400.Phone.__init__(self,logtarget,commport) 61 com_lg.LGNewIndexedMedia.__init__(self) 62 self.mode=self.MODENONE
63 64 my_model='VX7000'
65 66 parentprofile=com_lgvx4400.Profile
67 -class Profile(parentprofile):
68 protocolclass=Phone.protocolclass 69 serialsname=Phone.serialsname 70 phone_manufacturer='LG Electronics Inc' 71 phone_model='VX7000' 72 73 WALLPAPER_WIDTH=176 74 WALLPAPER_HEIGHT=184 75 MAX_WALLPAPER_BASENAME_LENGTH=32 76 WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 77 WALLPAPER_CONVERT_FORMAT="jpg" 78 79 MAX_RINGTONE_BASENAME_LENGTH=32 80 RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 81 82 # the 7000 doesn't have seperate origins - they are all dumped in "images" 83 imageorigins={} 84 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
85 - def GetImageOrigins(self):
86 return self.imageorigins
87 88 # our targets are the same for all origins 89 imagetargets={} 90 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 91 {'width': 176, 'height': 184, 'format': "JPEG"})) 92 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 93 {'width': 176, 'height': 184, 'format': "JPEG"})) 94 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd", 95 {'width': 96, 'height': 80, 'format': "JPEG"})) 96 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen", 97 {'width': 176, 'height': 220, 'format': "JPEG"})) 98
99 - def GetTargetsForImageOrigin(self, origin):
100 return self.imagetargets
101 102
103 - def __init__(self):
104 parentprofile.__init__(self)
105 106 _supportedsyncs=( 107 ('phonebook', 'read', None), # all phonebook reading 108 ('calendar', 'read', None), # all calendar reading 109 ('wallpaper', 'read', None), # all wallpaper reading 110 ('ringtone', 'read', None), # all ringtone reading 111 ('call_history', 'read', None),# all call history list reading 112 ('sms', 'read', None), # all SMS list reading 113 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 114 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 115 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 116 ('wallpaper', 'write', 'OVERWRITE'), 117 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 118 ('ringtone', 'write', 'OVERWRITE'), 119 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 120 )
121