0001 ### BITPIM 0002 ### 0003 ### Copyright (C) 2004 Roger Binns <rogerb@rogerbinns.com> 0004 ### 0005 ### This program is free software; you can redistribute it and/or modify 0006 ### it under the terms of the BitPim license as detailed in the LICENSE file. 0007 ### 0008 ### $Id: com_lgvx4600.py 3918 2007-01-19 05:15:12Z djpham $ 0009 0010 """Communicate with the LG VX4500 cell phone 0011 0012 The VX4600 is substantially similar to the VX4400, although 0013 wallpapers and ringtones are done in a totally different way. 0014 0015 """ 0016 0017 # standard modules 0018 import time 0019 import cStringIO 0020 import sha 0021 0022 # my modules 0023 import common 0024 import copy 0025 import p_lgvx4600 0026 import com_lgvx4400 0027 import com_brew 0028 import com_phone 0029 import com_lg 0030 import prototypes 0031 0032 class Phone(com_lg.LGDirectoryMedia,com_lgvx4400.Phone): 0033 "Talk to the LG VX4600 cell phone" 0034 0035 desc="LG-VX4600" 0036 helpid=None 0037 protocolclass=p_lgvx4600 0038 serialsname='lgvx4600' 0039 0040 # more VX4600 indices 0041 imagelocations=( 0042 # offset location origin maxentries 0043 (50, "usr/Wallpaper", "images", 30), 0044 ) 0045 0046 ringtonelocations=( 0047 # offset location origin maxentries 0048 (50, "usr/Ringtone", "ringers", 30), 0049 ) 0050 0051 builtinimages=('Butterfly', 'Flowers', 'Bird', 'Puppy','Fall', 0052 'Castle', 'Puppy2', 'Sky', 'Teddy','Desert') 0053 0054 builtinringtones=( 'Ring 1', 'Ring 2', 'Ring 3', 'Ring 4', 'Ring 5', 0055 'Ring 6','Ring 7','Ring 8','Ring 9','Ring 10', 0056 'Annen Polka','Beethoven Symphony No. 9', 'Pachelbel Canon', 0057 'Hallelujah', 'La Traviata','Leichte Kavallerie Overture', 0058 'Mozart Symphony No. 40', 'Bach Minuet','Farewell', 0059 'Mozart Piano Sonata','String','Trout', 'O solemio', 0060 'Pizzcato Polka','Stars and Stripes Forever','Pineapple Rag', 0061 'When the Saints Go Marching In','Latin','Carol 1','Carol 2') 0062 0063 def __init__(self, logtarget, commport): 0064 com_lgvx4400.Phone.__init__(self,logtarget,commport) 0065 com_lg.LGDirectoryMedia.__init__(self) 0066 self.mode=self.MODENONE 0067 0068 my_model='VX4600' 0069 0070 parentprofile=com_lgvx4400.Profile 0071 class Profile(parentprofile): 0072 protocolclass=Phone.protocolclass 0073 serialsname=Phone.serialsname 0074 phone_manufacturer='LG Electronics Inc' 0075 phone_model='VX4600' 0076 0077 WALLPAPER_WIDTH=120 0078 WALLPAPER_HEIGHT=131 0079 MAX_WALLPAPER_BASENAME_LENGTH=19 0080 WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 0081 WALLPAPER_CONVERT_FORMAT="bmp" 0082 0083 MAX_RINGTONE_BASENAME_LENGTH=19 0084 RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 0085 0086 imageorigins={} 0087 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) 0088 def GetImageOrigins(self): 0089 return self.imageorigins 0090 0091 # our targets are the same for all origins 0092 imagetargets={} 0093 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 0094 {'width': 120, 'height': 131, 'format': "BMP"})) 0095 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 0096 {'width': 120, 'height': 131, 'format': "BMP"})) 0097 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen", 0098 {'width': 120, 'height': 160, 'format': "BMP"})) 0099 0100 def GetTargetsForImageOrigin(self, origin): 0101 return self.imagetargets 0102 0103 _supportedsyncs=( 0104 ('phonebook', 'read', None), # all phonebook reading 0105 ('calendar', 'read', None), # all calendar reading 0106 ('wallpaper', 'read', None), # all wallpaper reading 0107 ('ringtone', 'read', None), # all ringtone reading 0108 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 0109 # ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 0110 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 0111 ('wallpaper', 'write', 'OVERWRITE'), 0112 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 0113 ('ringtone', 'write', 'OVERWRITE'), 0114 ) 0115 0116 def __init__(self): 0117 parentprofile.__init__(self) 0118
Generated by PyXR 0.9.4