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

Source Code for Module phones.com_lgvx4600

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2004 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_lgvx4600.py 3918 2007-01-19 05:15:12Z djpham $ 
  9   
 10  """Communicate with the LG VX4500 cell phone 
 11   
 12  The VX4600 is substantially similar to the VX4400, although 
 13  wallpapers and ringtones are done in a totally different way. 
 14   
 15  """ 
 16   
 17  # standard modules 
 18  import time 
 19  import cStringIO 
 20  import sha 
 21   
 22  # my modules 
 23  import common 
 24  import copy 
 25  import p_lgvx4600 
 26  import com_lgvx4400 
 27  import com_brew 
 28  import com_phone 
 29  import com_lg 
 30  import prototypes 
 31   
32 -class Phone(com_lg.LGDirectoryMedia,com_lgvx4400.Phone):
33 "Talk to the LG VX4600 cell phone" 34 35 desc="LG-VX4600" 36 helpid=None 37 protocolclass=p_lgvx4600 38 serialsname='lgvx4600' 39 40 # more VX4600 indices 41 imagelocations=( 42 # offset location origin maxentries 43 (50, "usr/Wallpaper", "images", 30), 44 ) 45 46 ringtonelocations=( 47 # offset location origin maxentries 48 (50, "usr/Ringtone", "ringers", 30), 49 ) 50 51 builtinimages=('Butterfly', 'Flowers', 'Bird', 'Puppy','Fall', 52 'Castle', 'Puppy2', 'Sky', 'Teddy','Desert') 53 54 builtinringtones=( 'Ring 1', 'Ring 2', 'Ring 3', 'Ring 4', 'Ring 5', 55 'Ring 6','Ring 7','Ring 8','Ring 9','Ring 10', 56 'Annen Polka','Beethoven Symphony No. 9', 'Pachelbel Canon', 57 'Hallelujah', 'La Traviata','Leichte Kavallerie Overture', 58 'Mozart Symphony No. 40', 'Bach Minuet','Farewell', 59 'Mozart Piano Sonata','String','Trout', 'O solemio', 60 'Pizzcato Polka','Stars and Stripes Forever','Pineapple Rag', 61 'When the Saints Go Marching In','Latin','Carol 1','Carol 2') 62
63 - def __init__(self, logtarget, commport):
64 com_lgvx4400.Phone.__init__(self,logtarget,commport) 65 com_lg.LGDirectoryMedia.__init__(self) 66 self.mode=self.MODENONE
67 68 my_model='VX4600'
69 70 parentprofile=com_lgvx4400.Profile
71 -class Profile(parentprofile):
72 protocolclass=Phone.protocolclass 73 serialsname=Phone.serialsname 74 phone_manufacturer='LG Electronics Inc' 75 phone_model='VX4600' 76 77 WALLPAPER_WIDTH=120 78 WALLPAPER_HEIGHT=131 79 MAX_WALLPAPER_BASENAME_LENGTH=19 80 WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 81 WALLPAPER_CONVERT_FORMAT="bmp" 82 83 MAX_RINGTONE_BASENAME_LENGTH=19 84 RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 85 86 imageorigins={} 87 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
88 - def GetImageOrigins(self):
89 return self.imageorigins
90 91 # our targets are the same for all origins 92 imagetargets={} 93 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 94 {'width': 120, 'height': 131, 'format': "BMP"})) 95 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 96 {'width': 120, 'height': 131, 'format': "BMP"})) 97 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen", 98 {'width': 120, 'height': 160, 'format': "BMP"})) 99
100 - def GetTargetsForImageOrigin(self, origin):
101 return self.imagetargets
102 103 _supportedsyncs=( 104 ('phonebook', 'read', None), # all phonebook reading 105 ('calendar', 'read', None), # all calendar reading 106 ('wallpaper', 'read', None), # all wallpaper reading 107 ('ringtone', 'read', None), # all ringtone reading 108 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 109 # ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 110 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 111 ('wallpaper', 'write', 'OVERWRITE'), 112 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 113 ('ringtone', 'write', 'OVERWRITE'), 114 ) 115
116 - def __init__(self):
117 parentprofile.__init__(self)
118