PyXR

c:\projects\bitpim\src \ phones \ com_lgvx5200.py



0001 ### BITPIM
0002 ###
0003 ### Copyright (C) 2003-2005 Roger Binns <rogerb@rogerbinns.com>
0004 ### Copyright (C) 2005 Simon Capper <skyjunky@sbcglobal.net>
0005 ###
0006 ### This program is free software; you can redistribute it and/or modify
0007 ### it under the terms of the BitPim license as detailed in the LICENSE file.
0008 ###
0009 ### $Id: com_lgvx5200.py 4303 2007-07-13 20:46:53Z djpham $
0010 
0011 """Communicate with the LG VX5200 cell phone
0012 
0013 
0014 The code in this file mainly inherits from VX8100 code and then extends where
0015 the 5200 has different functionality
0016 
0017 """
0018 
0019 # standard modules
0020 import time
0021 import cStringIO
0022 import sha
0023 
0024 # my modules
0025 import common
0026 import commport
0027 import copy
0028 import com_lgvx4400
0029 import p_brew
0030 import p_lgvx5200
0031 import com_lgvx8100
0032 import com_brew
0033 import com_phone
0034 import com_lg
0035 import prototypes
0036 import bpcalendar
0037 import call_history
0038 import sms
0039 import memo
0040 import helpids
0041 
0042 class Phone(com_lgvx8100.Phone):
0043     "Talk to the LG VX5200 cell phone"
0044 
0045     desc="LG-VX5200"
0046     helpid=helpids.ID_PHONE_LGVX5200
0047     protocolclass=p_lgvx5200
0048     serialsname='lgvx5200'
0049 
0050     builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone') + \
0051                       tuple(['Ringtone '+`n` for n in range(1,11)]) + \
0052                       ('No Ring',)
0053 
0054     ringtonelocations= (
0055         # type       index-file   size-file directory-to-use lowest-index-to-use maximum-entries type-major icon idx_offset
0056         ( 'ringers', 'dload/ringtone.dat', '', 'user/sound/ringer', 100, 150, 0x201, 1, 0),
0057         ( 'sounds', 'dload/sound.dat', 'dload/soundsize.dat', 'dload/snd', 100, 150, 0x402, 0, 151),
0058         )
0059 
0060     calendarlocation="sch/schedule.dat"
0061     calendarexceptionlocation="sch/schexception.dat"
0062     calenderrequiresreboot=1
0063     memolocation="sch/memo.dat"
0064 
0065     builtinwallpapers = () # none
0066 
0067     wallpaperlocations= (
0068         ( 'images', 'dload/image.dat', 'dload/imagesize.dat', 'dload/img', 100, 50, 0, 0, 0),
0069         )
0070     
0071     def __init__(self, logtarget, commport):
0072         com_lgvx4400.Phone.__init__(self,logtarget,commport)
0073         self.mode=self.MODENONE
0074 
0075     def __del__(self):
0076         pass
0077 
0078     my_model='VX5200'
0079 
0080     # Media stuff---------------------------------------------------------------
0081     # Bypassing the 8100/9800 specific stuff
0082     def getmedia(self, maps, results, key):
0083         return com_lg.LGNewIndexedMedia2.getmedia(self, maps, results, key)
0084     def savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction):
0085         return com_lg.LGNewIndexedMedia2.savemedia(self, mediakey, mediaindexkey, maps, results, merge, reindexfunction)
0086 
0087 parentprofile=com_lgvx8100.Profile
0088 class Profile(parentprofile):
0089     protocolclass=Phone.protocolclass
0090     serialsname=Phone.serialsname
0091 
0092     BP_Calendar_Version=3
0093     phone_manufacturer='LG Electronics Inc'
0094     phone_model='VX5200'
0095 
0096     WALLPAPER_WIDTH=275
0097     WALLPAPER_HEIGHT=175
0098     MAX_WALLPAPER_BASENAME_LENGTH=32
0099     WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ."
0100     WALLPAPER_CONVERT_FORMAT="jpg"
0101    
0102     # the 5200 uses "W" for wait in the dialstring, it does not support "T"
0103     DIALSTRING_CHARS="[^0-9PW#*]"
0104 
0105     MAX_RINGTONE_BASENAME_LENGTH=32
0106     RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ."
0107 
0108     # the 5200 doesn't have seperate origins - they are all dumped in "images"
0109     imageorigins={}
0110     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
0111     def GetImageOrigins(self):
0112         return self.imageorigins
0113 
0114     ringtoneorigins=('ringers', 'sounds')
0115     excluded_ringtone_origins=('sounds')
0116 
0117     # our targets are the same for all origins
0118     imagetargets={}
0119     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
0120                                       {'width': 275, 'height': 175, 'format': "JPEG"}))
0121 
0122     def GetTargetsForImageOrigin(self, origin):
0123         return self.imagetargets
0124 
0125  
0126     def __init__(self):
0127         parentprofile.__init__(self)
0128 
0129     _supportedsyncs=(
0130         ('phonebook', 'read', None),  # all phonebook reading
0131         ('calendar', 'read', None),   # all calendar reading
0132         ('wallpaper', 'read', None),  # all wallpaper reading
0133         ('ringtone', 'read', None),   # all ringtone reading
0134         ('call_history', 'read', None),# all call history list reading
0135         ('sms', 'read', None),         # all SMS list reading
0136         ('memo', 'read', None),        # all memo list reading
0137         ('phonebook', 'write', 'OVERWRITE'),  # only overwriting phonebook
0138         ('calendar', 'write', 'OVERWRITE'),   # only overwriting calendar
0139         ('wallpaper', 'write', 'MERGE'),      # merge and overwrite wallpaper
0140         ('wallpaper', 'write', 'OVERWRITE'),
0141         ('ringtone', 'write', 'MERGE'),      # merge and overwrite ringtone
0142         ('ringtone', 'write', 'OVERWRITE'),
0143         ('sms', 'write', 'OVERWRITE'),        # all SMS list writing
0144         ('memo', 'write', 'OVERWRITE'),       # all memo list writing
0145         )
0146 

Generated by PyXR 0.9.4