PyXR

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



0001 ### BITPIM
0002 ###
0003 ### Copyright (C) 2003-2005 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_lgvx7000.py 3918 2007-01-19 05:15:12Z djpham $
0009 
0010 """Communicate with the LG VX7000 cell phone
0011 
0012 The VX7000 is substantially similar to the VX6000 but also supports video.
0013 
0014 The code in this file mainly inherits from VX4400 code and then extends where
0015 the 6000 has extra 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 copy
0027 import p_lgvx7000
0028 import com_lgvx4400
0029 import com_brew
0030 import com_phone
0031 import com_lg
0032 import prototypes
0033 import helpids
0034 
0035 class Phone(com_lg.LGNewIndexedMedia,com_lgvx4400.Phone):
0036     "Talk to the LG VX7000 cell phone"
0037 
0038     desc="LG-VX7000"
0039     helpid=helpids.ID_PHONE_LGVX7000
0040     protocolclass=p_lgvx7000
0041     serialsname='lgvx7000'
0042 
0043     builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps') + \
0044                       tuple(['Ringtone '+`n` for n in range(1,11)]) + \
0045                       ('No Ring',)
0046 
0047     ringtonelocations= (
0048         # type       index-file   size-file directory-to-use lowest-index-to-use maximum-entries type-major
0049         ( 'ringers', 'dload/sound.dat', 'dload/soundsize.dat', 'dload/snd', 100, 50, 1),
0050         )
0051 
0052     builtinwallpapers = () # none
0053 
0054     wallpaperlocations= (
0055         ( 'images', 'dload/image.dat', 'dload/imagesize.dat', 'dload/img', 100, 50, 0),
0056         )
0057         
0058     
0059     def __init__(self, logtarget, commport):
0060         com_lgvx4400.Phone.__init__(self,logtarget,commport)
0061         com_lg.LGNewIndexedMedia.__init__(self)
0062         self.mode=self.MODENONE
0063 
0064     my_model='VX7000'
0065 
0066 parentprofile=com_lgvx4400.Profile
0067 class Profile(parentprofile):
0068     protocolclass=Phone.protocolclass
0069     serialsname=Phone.serialsname
0070     phone_manufacturer='LG Electronics Inc'
0071     phone_model='VX7000'
0072 
0073     WALLPAPER_WIDTH=176
0074     WALLPAPER_HEIGHT=184
0075     MAX_WALLPAPER_BASENAME_LENGTH=32
0076     WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
0077     WALLPAPER_CONVERT_FORMAT="jpg"
0078    
0079     MAX_RINGTONE_BASENAME_LENGTH=32
0080     RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
0081 
0082     # the 7000 doesn't have seperate origins - they are all dumped in "images"
0083     imageorigins={}
0084     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
0085     def GetImageOrigins(self):
0086         return self.imageorigins
0087 
0088     # our targets are the same for all origins
0089     imagetargets={}
0090     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
0091                                       {'width': 176, 'height': 184, 'format': "JPEG"}))
0092     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid",
0093                                       {'width': 176, 'height': 184, 'format': "JPEG"}))
0094     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd",
0095                                       {'width': 96, 'height': 80, 'format': "JPEG"}))
0096     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen",
0097                                       {'width': 176, 'height': 220, 'format': "JPEG"}))
0098 
0099     def GetTargetsForImageOrigin(self, origin):
0100         return self.imagetargets
0101 
0102  
0103     def __init__(self):
0104         parentprofile.__init__(self)
0105 
0106     _supportedsyncs=(
0107         ('phonebook', 'read', None),  # all phonebook reading
0108         ('calendar', 'read', None),   # all calendar reading
0109         ('wallpaper', 'read', None),  # all wallpaper reading
0110         ('ringtone', 'read', None),   # all ringtone reading
0111         ('call_history', 'read', None),# all call history list reading
0112         ('sms', 'read', None),         # all SMS list reading
0113         ('phonebook', 'write', 'OVERWRITE'),  # only overwriting phonebook
0114         ('calendar', 'write', 'OVERWRITE'),   # only overwriting calendar
0115         ('wallpaper', 'write', 'MERGE'),      # merge and overwrite wallpaper
0116         ('wallpaper', 'write', 'OVERWRITE'),
0117         ('ringtone', 'write', 'MERGE'),      # merge and overwrite ringtone
0118         ('ringtone', 'write', 'OVERWRITE'),
0119         ('sms', 'write', 'OVERWRITE'),        # all SMS list writing
0120         )
0121 

Generated by PyXR 0.9.4