0001 #!/usr/bin/env python 0002 0003 ### BITPIM 0004 ### 0005 ### Copyright (C) 2008 Nathan Hjelm <hjelmn@users.sourceforge.net> 0006 ### 0007 ### This program is free software; you can redistribute it and/or modify 0008 ### it under the terms of the BitPim license as detailed in the LICENSE file. 0009 ### 0010 ### $Id: com_lgvx9700.py 4678 2008-08-13 23:46:56Z djpham $ 0011 0012 0013 0014 """ 0015 Communicate with the LG VX9700 cell phone. 0016 """ 0017 0018 # BitPim modules 0019 import common 0020 import com_brew 0021 import prototypes 0022 import com_lgvx10000 0023 import p_lgvx9700 0024 import helpids 0025 import sms 0026 0027 #------------------------------------------------------------------------------- 0028 parentphone=com_lgvx10000.Phone 0029 class Phone(parentphone): 0030 desc="LG-VX9700 (Dare)" 0031 helpid=helpids.ID_PHONE_LGVX9700 0032 protocolclass=p_lgvx9700 0033 serialsname='lgvx9700' 0034 0035 my_model='VX9700' 0036 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone', 0037 'Home Phone', 'Simple Beep', 'Short Note Beep', 'Old Bell', 'Move Bell', 'Wahwah', 0038 'Just Fine', 'Froggy Night', 'Whistling Wizard', 'Like a Movie', 'Deep Blue Sea', 0039 'Sweet & Twenty', 'Funky Band', 'Why Not', 'Mystique', 'Evening Grow', 'This Time', 0040 'Hawaiian Punch', 'L.O.V.E.', 'Night Sky', 'No Ring',) 0041 0042 def setDMversion(self): 0043 self._DMv5=False 0044 self._DMv6=True 0045 self._timeout=5 # Assume a quick timeout on newer phones 0046 0047 # Fundamentals: 0048 # - get_esn - same as LG VX-8300 0049 # - getgroups - same as LG VX-8700 0050 # - getwallpaperindices - LGUncountedIndexedMedia 0051 # - getringtoneindices - LGUncountedIndexedMedia 0052 # - DM Version - 6 0053 # - phonebook - same as LG VX-8550 0054 # - SMS - same dir structure as the VX-8800 0055 0056 def _getoutboxmessage(self, sf): 0057 entry=sms.SMSEntry() 0058 entry.folder=entry.Folder_Sent 0059 entry.datetime="%d%02d%02dT%02d%02d%02d" % ((sf.timesent)) 0060 # add all the recipients 0061 for r in sf.recipients: 0062 if r.number: 0063 confirmed=(r.status==5) 0064 confirmed_date=None 0065 if confirmed: 0066 confirmed_date="%d%02d%02dT%02d%02d%02d" % r.timereceived 0067 entry.add_recipient(r.number, confirmed, confirmed_date) 0068 entry.subject=sf.subject 0069 txt="" 0070 if sf.num_msg_elements==1 and not sf.messages[0].binary: 0071 txt=self._get_text_from_sms_msg_without_header(sf.messages[0].msg, sf.messages[0].length) 0072 else: 0073 for i in range(sf.num_msg_elements): 0074 txt+=self._get_text_from_sms_msg_with_header(sf.messages[i].msg, sf.messages[i].length) 0075 entry.text=unicode(txt, errors='ignore') 0076 if sf.priority==0: 0077 entry.priority=sms.SMSEntry.Priority_Normal 0078 else: 0079 entry.priority=sms.SMSEntry.Priority_High 0080 entry.locked=sf.locked 0081 entry.callback=sf.callback 0082 return entry 0083 0084 def _getinboxmessage(self, sf): 0085 entry=sms.SMSEntry() 0086 entry.folder=entry.Folder_Inbox 0087 entry.datetime="%d%02d%02dT%02d%02d%02d" % (sf.GPStime) 0088 entry._from=sf.sender if sf.sender else sf.sender_name 0089 entry.subject=sf.subject 0090 entry.locked=sf.locked 0091 if sf.priority==0: 0092 entry.priority=sms.SMSEntry.Priority_Normal 0093 else: 0094 entry.priority=sms.SMSEntry.Priority_High 0095 entry.read=sf.read 0096 txt="" 0097 _decode_func=self._get_text_from_sms_msg_with_header if \ 0098 sf.msgs[1].msg_length else \ 0099 self._get_text_from_sms_msg_without_header 0100 for _entry in sf.msgs: 0101 if _entry.msg_length: 0102 txt+=_decode_func(_entry.msg_data.msg, _entry.msg_length) 0103 entry.text=unicode(txt, errors='ignore') 0104 entry.callback=sf.callback 0105 return entry 0106 0107 #------------------------------------------------------------------------------- 0108 parentprofile=com_lgvx10000.Profile 0109 class Profile(parentprofile): 0110 protocolclass=Phone.protocolclass 0111 serialsname=Phone.serialsname 0112 0113 BP_Calendar_Version=3 0114 phone_manufacturer='LG Electronics Inc' 0115 phone_model='VX9700' 0116 # inside screen resoluation 0117 WALLPAPER_WIDTH = 400 0118 WALLPAPER_HEIGHT = 240 0119 0120 imageorigins={} 0121 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) 0122 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video")) 0123 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)")) 0124 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)")) 0125 0126 # our targets are the same for all origins 0127 imagetargets={} 0128 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd", 0129 {'width': 240, 'height': 400, 'format': "JPEG"})) 0130 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 0131 {'width': 400, 'height': 240, 'format': "JPEG"})) 0132 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 0133 {'width': 120, 'height': 100, 'format': "JPEG"})) 0134 0135 _supportedsyncs=( 0136 ('phonebook', 'read', None), # all phonebook reading 0137 ('calendar', 'read', None), # all calendar reading 0138 ('wallpaper', 'read', None), # all wallpaper reading 0139 ('ringtone', 'read', None), # all ringtone reading 0140 ('call_history', 'read', None),# all call history list reading 0141 ('sms', 'read', None), # all SMS list reading 0142 ('memo', 'read', None), # all memo list reading 0143 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 0144 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 0145 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 0146 ('wallpaper', 'write', 'OVERWRITE'), 0147 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 0148 ('ringtone', 'write', 'OVERWRITE'), 0149 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 0150 ('memo', 'write', 'OVERWRITE'), # all memo list writing 0151 ## ('playlist', 'read', 'OVERWRITE'), 0152 ## ('playlist', 'write', 'OVERWRITE'), 0153 ('t9_udb', 'write', 'OVERWRITE'), 0154 ) 0155 if __debug__: 0156 _supportedsyncs+=( 0157 ('t9_udb', 'read', 'OVERWRITE'), 0158 ) 0159
Generated by PyXR 0.9.4