Package phones :: Module com_sanyonewer
[hide private]
[frames] | no frames]

Source Code for Module phones.com_sanyonewer

 1  ### BITPIM 
 2  ### 
 3  ### Copyright (C) 2004 Stephen Wood <sawecw@users.sf.net> 
 4  ### 
 5  ### This program is free software; you can redistribute it and/or modify 
 6  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
 7  ### 
 8  ### $Id: com_sanyonewer.py 3918 2007-01-19 05:15:12Z djpham $ 
 9   
10  """Common code for newer SCP-5500 style phones""" 
11   
12  # standard modules 
13  import time 
14  import cStringIO 
15   
16  # my modules 
17  import common 
18  import p_sanyonewer 
19  import com_brew 
20  import com_phone 
21  import com_sanyo 
22  import com_sanyomedia 
23  import prototypes 
24  import helpids 
25   
26 -class Phone(com_sanyomedia.SanyoMedia,com_sanyo.Phone):
27 "Talk to a Sanyo SCP-5500 style cell phone" 28 helpid=helpids.ID_PHONE_SANYOOTHERS 29 builtinringtones=( 'None', 'Vibrate', 'Ringer & Voice', '', '', '', '', '', '', 30 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5', 31 'Tone 6', 'Tone 7', 'Tone 8', '', '', '', '', '', 32 '', '', '', '', '', '', '', 33 'Tschaik.Swanlake', 'Satie Gymnop.#1', 34 'Bach Air on the G', 'Beethoven Sym.5', 'Greensleeves', 35 'Johnny Comes..', 'Foster Ky. Home', 'Asian Jingle', 36 'Disco', 'Toy Box', 'Rodeo' ) 37 38 calendar_defaultringtone=4 39 calendar_defaultcaringtone=4 40 calendar_tonerange=xrange(18,26) 41 calendar_toneoffset=8 42
43 - def __init__(self, logtarget, commport):
44 com_sanyo.Phone.__init__(self, logtarget, commport) 45 com_sanyomedia.SanyoMedia.__init__(self) 46 self.mode=self.MODENONE
47
48 - def sendpbcommand(self, request, responseclass, callsetmode=True, writemode=False, numsendretry=2, returnerror=False):
49 50 # writemode seems not to be needed for this phone 51 res=com_sanyo.Phone.sendpbcommand(self, request, responseclass, callsetmode=callsetmode, writemode=False, numsendretry=numsendretry, returnerror=returnerror) 52 return res
53 54
55 - def savecalendar(self, dict, merge):
56 req=self.protocolclass.beginendupdaterequest() 57 req.beginend=1 # Start update 58 res=self.sendpbcommand(req, self.protocolclass.beginendupdateresponse, writemode=True) 59 60 self.writewait() 61 result = com_sanyo.Phone.savecalendar(self, dict, merge)
62
63 -class Profile(com_sanyo.Profile):
64 65 WALLPAPER_WIDTH=132 66 WALLPAPER_HEIGHT=144 67 OVERSIZE_PERCENTAGE=100 68 69 _supportedsyncs=( 70 ('phonebook', 'read', None), # all phonebook reading 71 ('calendar', 'read', None), # all calendar reading 72 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 73 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 74 ('wallpaper', 'write', 'MERGE'), 75 ('ringtone', 'write', 'MERGE'), 76 ('wallpaper', 'read', None), # all wallpaper reading 77 ('ringtone', 'read', None), # all ringtone reading 78 ('call_history', 'read', None),# all call history list reading 79 ('sms', 'read', None), # Read sms messages 80 ('todo', 'read', None), # Read todos 81 ) 82
83 - def __init__(self):
85