Package phones ::
Module com_samsungschu470
|
|
1
2
3
4
5
6
7
8
9
10 """Communicate with the Samsung SCH-U470 (Juke) Phone"""
11
12 import common
13 import com_samsungschu740 as u740
14 import p_samsungschu470 as p_u470
15 import helpids
16
17 parentphone=u740.Phone
19 desc='SCH-U470'
20 helpid=helpids.ID_PHONE_SAMSUNGSCHU470
21 protocolclass=p_u470
22 serialsname='schu470'
23
24 ringtone_noring_range='range_tones_preloaded_el_no_rings'
25 ringtone_default_range='range_tones_preloaded_el_01'
26 builtin_ringtones={
27 'VZW Default Tone': ringtone_default_range,
28 'Bell 1': 'range_tones_preloaded_el_02',
29 'Bell 2': 'range_tones_preloaded_el_03',
30 'Bell 3': 'range_tones_preloaded_el_04',
31 'Melody 1': 'range_tones_preloaded_el_05',
32 'Melody 2': 'range_tones_preloaded_el_06',
33 'Melody 3': 'range_tones_preloaded_el_07',
34 'Melody 4': 'range_tones_preloaded_el_08',
35 'Melody 5': 'range_tones_preloaded_el_09',
36 'Melody 6': 'range_tones_preloaded_el_10',
37 'Beep Once': 'range_tones_preloaded_el_11',
38 'No Ring': ringtone_noring_range,
39 }
40
41 builtin_sounds={}
42
43
44
45
46
47
48
49
50
51
52 builtin_wallpapers={
53 'Preloaded1': 'range_f_wallpaper_preloaded_el_01',
54 'Preloaded2': 'range_f_wallpaper_preloaded_el_02',
55 'Preloaded3': 'range_f_wallpaper_preloaded_el_03',
56 'Preloaded4': 'range_f_wallpaper_preloaded_el_04',
57 'Preloaded5': 'range_f_wallpaper_preloaded_el_05',
58 }
59 builtin_groups={
60 1: 'Business',
61 2: 'Colleague',
62 3: 'Family',
63 4: 'Friends'
64 }
65
66 my_model='SCH-U470/Juke'
67 my_manufacturer='SAMSUNG'
68 detected_model='U470'
69
70 - def __init__(self, logtarget, commport):
71 "Calls all the constructors and sets initial modes"
72 parentphone.__init__(self, logtarget, commport)
73 global PBEntry
74 self.pbentryclass=PBEntry
75
77 fundamentals['ringtone-range']={}
78
97
111
112
121
129
131
132 """Save wallpapers to the phone"""
133 self.log('Writing wallpapers to the phone')
134 try:
135 _del_list, _new_list=self._get_del_new_list('wallpaper-index',
136 'wallpapers',
137 merge,
138 fundamentals,
139 frozenset(['video']))
140 if __debug__:
141 self.log('Delete list: '+','.join(_del_list))
142 self.log('New list: '+','.join(_new_list))
143 self._add_files('wallpaper-index', 'wallpapers',
144 _new_list, fundamentals)
145 fundamentals['rebootphone']=True
146 except:
147 if __debug__:
148 raise
149 return fundamentals
150
151
152 parentcalendarentry=u740.CalendarEntry
153 -class CalendarEntry(parentcalendarentry):
155
156
157 parentpbentry=u740.PBEntry
158 -class PBEntry(parentpbentry):
159
161 if self.pb.has_ringtone and \
162 self.pb.ringtone:
163 if self.pb.ringtone.startswith('/ff/'):
164
165 _ringtone=common.basename(self.pb.ringtone)
166 else:
167
168 _ringtone=self.phone.ringtone_name_from_range(
169 self.pb.ringtone, self.fundamentals)
170 if _ringtone:
171 entry['ringtones']=[{ 'ringtone': _ringtone,
172 'use': 'call' }]
173
174 - def getvalue(self):
178
179
180 parentprofile=u740.Profile
182 serialsname=Phone.serialsname
183 WALLPAPER_WIDTH=176
184 WALLPAPER_HEIGHT=220
185 autodetect_delay=3
186 usbids=( ( 0x04e8, 0x6640, 2),)
187 deviceclasses=("serial",)
188 BP_Calendar_Version=3
189
190 phone_manufacturer=Phone.my_manufacturer
191 phone_model=Phone.my_model
192
193
194 imagetargets={}
195 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
196 {'width': 128, 'height': 164, 'format': "JPEG"}))
197 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid",
198 {'width': 112, 'height': 84, 'format': "JPEG"}))
199 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen",
200 {'width': 128, 'height': 220, 'format': "JPEG"}))
201 imageorigins={}
202 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
203