0001 ### BITPIM 0002 ### 0003 ### Copyright (C) 2004 Stephen Wood <sawecw@users.sf.net> 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_sanyonewer.py 3918 2007-01-19 05:15:12Z djpham $ 0009 0010 """Common code for newer SCP-5500 style phones""" 0011 0012 # standard modules 0013 import time 0014 import cStringIO 0015 0016 # my modules 0017 import common 0018 import p_sanyonewer 0019 import com_brew 0020 import com_phone 0021 import com_sanyo 0022 import com_sanyomedia 0023 import prototypes 0024 import helpids 0025 0026 class Phone(com_sanyomedia.SanyoMedia,com_sanyo.Phone): 0027 "Talk to a Sanyo SCP-5500 style cell phone" 0028 helpid=helpids.ID_PHONE_SANYOOTHERS 0029 builtinringtones=( 'None', 'Vibrate', 'Ringer & Voice', '', '', '', '', '', '', 0030 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5', 0031 'Tone 6', 'Tone 7', 'Tone 8', '', '', '', '', '', 0032 '', '', '', '', '', '', '', 0033 'Tschaik.Swanlake', 'Satie Gymnop.#1', 0034 'Bach Air on the G', 'Beethoven Sym.5', 'Greensleeves', 0035 'Johnny Comes..', 'Foster Ky. Home', 'Asian Jingle', 0036 'Disco', 'Toy Box', 'Rodeo' ) 0037 0038 calendar_defaultringtone=4 0039 calendar_defaultcaringtone=4 0040 calendar_tonerange=xrange(18,26) 0041 calendar_toneoffset=8 0042 0043 def __init__(self, logtarget, commport): 0044 com_sanyo.Phone.__init__(self, logtarget, commport) 0045 com_sanyomedia.SanyoMedia.__init__(self) 0046 self.mode=self.MODENONE 0047 0048 def sendpbcommand(self, request, responseclass, callsetmode=True, writemode=False, numsendretry=2, returnerror=False): 0049 0050 # writemode seems not to be needed for this phone 0051 res=com_sanyo.Phone.sendpbcommand(self, request, responseclass, callsetmode=callsetmode, writemode=False, numsendretry=numsendretry, returnerror=returnerror) 0052 return res 0053 0054 0055 def savecalendar(self, dict, merge): 0056 req=self.protocolclass.beginendupdaterequest() 0057 req.beginend=1 # Start update 0058 res=self.sendpbcommand(req, self.protocolclass.beginendupdateresponse, writemode=True) 0059 0060 self.writewait() 0061 result = com_sanyo.Phone.savecalendar(self, dict, merge) 0062 0063 class Profile(com_sanyo.Profile): 0064 0065 WALLPAPER_WIDTH=132 0066 WALLPAPER_HEIGHT=144 0067 OVERSIZE_PERCENTAGE=100 0068 0069 _supportedsyncs=( 0070 ('phonebook', 'read', None), # all phonebook reading 0071 ('calendar', 'read', None), # all calendar reading 0072 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 0073 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 0074 ('wallpaper', 'write', 'MERGE'), 0075 ('ringtone', 'write', 'MERGE'), 0076 ('wallpaper', 'read', None), # all wallpaper reading 0077 ('ringtone', 'read', None), # all ringtone reading 0078 ('call_history', 'read', None),# all call history list reading 0079 ('sms', 'read', None), # Read sms messages 0080 ('todo', 'read', None), # Read todos 0081 ) 0082 0083 def __init__(self): 0084 com_sanyo.Profile.__init__(self) 0085
Generated by PyXR 0.9.4