Clever searching over Bluetooth based on manufacturer.
[wammu.git] / Wammu / Data.py
blob53e6208c076ae153b122e50670f49b3ab0b0a393
1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
3 '''
4 Wammu - Phone manager
5 Some static data like bitmaps, category mappings etc.
6 Many of them might be moved to python-gammu later
7 '''
8 __author__ = 'Michal Čihař'
9 __email__ = 'michal@cihar.com'
10 __license__ = '''
11 Copyright (c) 2003 - 2007 Michal Čihař
13 This program is free software; you can redistribute it and/or modify it
14 under the terms of the GNU General Public License version 2 as published by
15 the Free Software Foundation.
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 more details.
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 '''
27 import sys
28 from gammu.Data import Connections, MemoryValueTypes, CalendarTypes, CalendarValueTypes, TodoPriorities, TodoValueTypes, InternationalPrefixes
31 # When support for sound will be implemented, here should be sounds
32 PredefinedSounds = [
33 (_('Chimes high'),''),
34 (_('Chimes low'),''),
35 (_('Ding'),''),
36 (_('TaDa'),''),
37 (_('Notify'),''),
38 (_('Drum'),''),
39 (_('Claps'),''),
40 (_('Fanfare'),''),
41 (_('Chord high'),''),
42 (_('Chord low'),''),
45 # Wanted somebody who will draw nicer icons :-)
47 Note = [
48 '16 16 2 1',
49 'x c Black',
50 ' c None',
51 ' xx ',
52 ' xxx xxx ',
53 ' xxxxxxxxx ',
54 ' xx xx xx',
55 ' xx ',
56 ' xx ',
57 ' xx ',
58 ' xx ',
59 ' xxxxxx ',
60 ' xxxxxxx ',
61 'xxxxxxxx ',
62 'xxxxxxxx ',
63 'x xxxxx ',
64 'x xxxx ',
65 ' x xxx ',
66 ' xxxx ']
68 UnknownPredefined = [
69 '16 16 2 1',
70 'x c Black',
71 ' c None',
72 ' xxxxxx ',
73 ' x x ',
74 ' x xxxx x ',
75 ' x x x x ',
76 ' x x x ',
77 ' x x ',
78 ' x x ',
79 ' x x ',
80 ' x x ',
81 ' x x ',
82 ' xx ',
83 ' ',
84 ' xx ',
85 ' xxxx ',
86 ' x xx ',
87 ' xx ']
89 PredefinedAnimations = [
90 (_("I'm ironic, flirty"),
91 ['16 16 2 1',
92 'x c Black',
93 ' c None',
94 ' xxxxxx ',
95 ' xx xx ',
96 ' x x ',
97 ' x x ',
98 ' x xx xx x ',
99 'x x x x x x',
100 'x xx xx x',
101 'x x',
102 'x x',
103 'x x',
104 'x x x x',
105 ' x x x x ',
106 ' x x x x ',
107 ' x xx x ',
108 ' xx xx ',
109 ' xxxxxx ']),
110 (_("I am glad"),
111 ['16 16 2 1',
112 'x c Black',
113 ' c None',
114 ' xxxxxx ',
115 ' xx xx ',
116 ' x x ',
117 ' x x ',
118 ' x xx xx x ',
119 'x x x x x x',
120 'x xx xx x',
121 'x x',
122 'x x',
123 'x x',
124 'x x x x',
125 ' x x x x ',
126 ' x xxxx x ',
127 ' x x ',
128 ' xx xx ',
129 ' xxxxxx ']),
130 (_("I am skeptic"),
131 ['16 16 2 1',
132 'x c Black',
133 ' c None',
134 ' xxxxxx ',
135 ' xx xx ',
136 ' x x ',
137 ' x x ',
138 ' x xx xx x ',
139 'x x x x x x',
140 'x xx xx x',
141 'x x',
142 'x x',
143 'x x',
144 'x xxxxx x',
145 ' x x x ',
146 ' x x x ',
147 ' x x ',
148 ' xx xx ',
149 ' xxxxxx ']),
150 (_("I am sad"),
151 ['16 16 2 1',
152 'x c Black',
153 ' c None',
154 ' xxxxxx ',
155 ' xx xx ',
156 ' x x ',
157 ' x x ',
158 ' x xx xx x ',
159 'x x x x x x',
160 'x xx xx x',
161 'x x',
162 'x x',
163 'x x',
164 'x xxxx x',
165 ' x x x x ',
166 ' x x x x ',
167 ' x x ',
168 ' xx xx ',
169 ' xxxxxx ']),
170 (_("WOW"),
171 ['16 16 2 1',
172 'x c Black',
173 ' c None',
174 ' xxxxxx ',
175 ' xx xx ',
176 ' x x ',
177 ' x x ',
178 ' x xx xx x ',
179 'x x x x x x',
180 'x xx xx x',
181 'x x',
182 'x x',
183 'x xxxx x',
184 'x x x x',
185 ' x x x x ',
186 ' x xxxx x ',
187 ' x x ',
188 ' xx xx ',
189 ' xxxxxx ']),
190 (_("I am crying"),
191 ['16 16 2 1',
192 'x c Black',
193 ' c None',
194 ' xxxxxx ',
195 ' xx xx ',
196 ' x x ',
197 ' x x ',
198 ' x xx xx x ',
199 'x x x x x x',
200 'x xx xx x',
201 'x x x x',
202 'x x',
203 'x x',
204 'x xxxx x',
205 ' x x x x ',
206 ' x xxxx x ',
207 ' x x ',
208 ' xx xx ',
209 ' xxxxxx ']),
210 (_("I am winking"),
211 ['16 16 2 1',
212 'x c Black',
213 ' c None',
214 ' xxxxxx ',
215 ' xx xx ',
216 ' x x ',
217 ' x x ',
218 ' x xx x ',
219 'x xxxx x x x',
220 'x xx xx x',
221 'x x',
222 'x x',
223 'x x',
224 'x x x x',
225 ' x xxxxxx x ',
226 ' x x ',
227 ' x x ',
228 ' xx xx ',
229 ' xxxxxx ']),
230 (_("I am laughing"),
231 ['16 16 2 1',
232 'x c Black',
233 ' c None',
234 ' xxxxxx ',
235 ' xx xx ',
236 ' x x ',
237 ' x x ',
238 ' x xx xx x ',
239 'x x x x x x',
240 'x xx xx x',
241 'x x',
242 'x x',
243 'x x',
244 'x x x x',
245 ' x xxxxxx x ',
246 ' x xxxx x ',
247 ' x x ',
248 ' xx xx ',
249 ' xxxxxx ']),
250 (_("I am indifferent"),
251 ['16 16 2 1',
252 'x c Black',
253 ' c None',
254 ' xxxxxx ',
255 ' xx xx ',
256 ' x x ',
257 ' x x ',
258 ' x xx xx x ',
259 'x x x x x x',
260 'x xx xx x',
261 'x x',
262 'x x',
263 'x x',
264 'x x',
265 ' x x ',
266 ' x xxxxxx x ',
267 ' x x ',
268 ' xx xx ',
269 ' xxxxxx ']),
270 (_("I am in love"),
271 ['16 16 2 1',
272 'x c Black',
273 ' c None',
274 ' xxxx xx xx ',
275 ' xx x x x',
276 ' x x x ',
277 ' x x x ',
278 ' x xx xx x x ',
279 'x x x x x x',
280 'x xx xx x',
281 'x x',
282 'x x',
283 'x x',
284 'x x',
285 ' x x x x ',
286 ' x xxxx x ',
287 ' x x ',
288 ' xx xx ',
289 ' xxxxxx ']),
290 (_("I am confused"),
291 ['16 16 2 1',
292 'x c Black',
293 ' c None',
294 ' xxxxxx xx ',
295 ' xx x x ',
296 ' x x ',
297 ' x x ',
298 ' x xx xx x',
299 'x x x x x x x',
300 'x xx xx x',
301 'x x',
302 'x x',
303 'x x',
304 'x x',
305 ' x xxxxx x ',
306 ' x x ',
307 ' x x ',
308 ' xx xx ',
309 ' xxxxxx ']),
310 (_("Tongue hanging out"),
311 ['16 16 2 1',
312 'x c Black',
313 ' c None',
314 ' xxxxxx ',
315 ' xx xx ',
316 ' x x ',
317 ' x x ',
318 ' x xx xx x ',
319 'x x x x x x',
320 'x xx xx x',
321 'x x',
322 'x x',
323 'x x',
324 'x x',
325 ' x x x ',
326 ' x xxxxx x x ',
327 ' x xx x ',
328 ' xx x x ',
329 ' xxxxxxxxx ']),
330 (_("I am angry"),
331 ['16 16 2 1',
332 'x c Black',
333 ' c None',
334 ' xxxxxx ',
335 ' xx xx ',
336 ' x x ',
337 ' x x x x ',
338 ' x xx xxx x ',
339 'x x x x x x',
340 'x xx xx x',
341 'x x',
342 'x x',
343 'x x',
344 'x xxxx x',
345 ' x x x x ',
346 ' x x x x ',
347 ' x x ',
348 ' xx xx ',
349 ' xxxxxx ']),
350 (_("Wearing glases"),
351 ['16 16 2 1',
352 'x c Black',
353 ' c None',
354 ' xxxxxx ',
355 ' xx xx ',
356 ' x x ',
357 ' x x ',
358 'xxxxxxxxxxxxxxxx',
359 'x xxx xxx x',
360 'x xx xx x',
361 'x x',
362 'x x',
363 'x x',
364 'x x',
365 ' x x x x ',
366 ' x xxxxxx x ',
367 ' x x ',
368 ' xx xx ',
369 ' xxxxxx ']),
370 (_("Devil"),
371 ['16 16 2 1',
372 'x c Black',
373 ' c None',
374 'x xxxxxx x',
375 'xxxxx xxxxx',
376 ' xx xx ',
377 ' x x ',
378 ' x xx xx x ',
379 'x x x x x x',
380 'x xx xx x',
381 'x x',
382 'x x',
383 'x xxxxxxxx x',
384 'x x x x x x',
385 ' x x x x ',
386 ' x xxxx x ',
387 ' x x ',
388 ' xx xx ',
389 ' xxxxxx ']),
392 # First is used as default
393 Models = [
394 'auto',
395 'at',
396 'alcatel',
397 'nauto',
398 'obex',
399 'seobex',
402 Conn_Generic = [
403 'at19200',
404 'at115200',
405 'obex',
407 Conn_Cable = [
408 'at19200',
409 'at115200',
410 'fbusdlr3',
411 'fbus',
412 'mbus',
413 'fbuspl2303',
414 'phonetblue',
415 'fbusblue',
417 Conn_IrDA_Win = [
418 'irdaphonet',
419 'irdaat',
421 Conn_IrDA_Other = [
422 'irdaphonet',
423 'at19200',
425 Conn_BlueRF = [
426 'at19200',
428 Conn_Bluetooth_All = [
429 'bluephonet',
430 'bluefbus',
431 'bluerfgnapbus',
432 'blueat',
433 'blueobex',
434 'bluerfobex',
435 'bluerfphonet',
436 'bluerffbus',
437 'bluerfat',
439 Conn_Bluetooth_Nokia = [
440 'bluephonet',
441 'bluefbus',
442 'bluerfgnapbus',
443 'bluerfphonet',
444 'bluerffbus',
445 'blueat',
446 'bluerfat',
447 'blueobex',
448 'bluerfobex',
450 Conn_Bluetooth_Standard = [
451 'blueat',
452 'blueobex',
453 'bluerfgnapbus',
455 Conn_Bluetooth = {
456 'Sony-Ericsson' : Conn_Bluetooth_Standard,
457 'Siemens' : Conn_Bluetooth_Standard,
458 'BenQ' : Conn_Bluetooth_Standard,
459 'Samsung' : Conn_Bluetooth_Standard,
460 'LG' : Conn_Bluetooth_Standard,
461 'Motorola' : Conn_Bluetooth_Standard,
462 'Nokia' : Conn_Bluetooth_Nokia,
463 'Alcatel' : Conn_Bluetooth_Standard,
465 if sys.platform == 'win32':
466 Devices = [
468 'com1:',
469 'com2:',
470 'com3:',
471 'com4:',
472 'com5:',
473 'com6:',
475 AllDevices = [
476 (Conn_IrDA_Win, '', None),
477 (Conn_Cable, 'com%d:', (1,6)),
479 # FIXME: support more platforms?
480 else:
481 Devices = [
482 '/dev/ttyS0',
483 '/dev/ttyS1',
484 '/dev/ttyUSB0',
485 '/dev/ttyUSB1',
486 '/dev/ttyACM0',
487 '/dev/ttyACM1',
488 '/dev/ircomm0',
489 '/dev/rfcomm0',
490 '/dev/usb/tts/0',
492 AllDevices = [
493 (Conn_Cable, '/dev/ttyS%d', (0, 3)),
494 (Conn_Cable, '/dev/ttyUSB%d', (0, 3)),
495 (Conn_Cable, '/dev/ttyACM%d', (0, 3)),
496 (Conn_BlueRF, '/dev/rfrcomm%d', (0, 1)),
497 (Conn_IrDA_Other, '/dev/ircomm%d', (0, 1)),
498 (Conn_Cable, '/dev/usb/tts/%d', (0, 3)),
501 ContactMemoryTypes = ['ME', 'SM']
503 SMSIDs = {
504 'Text': [
505 'Text',
506 'ConcatenatedTextLong',
507 'ConcatenatedAutoTextLong',
508 'ConcatenatedTextLong16bit',
509 'ConcatenatedAutoTextLong16bit',
510 'NokiaVCARD21Long',
511 'NokiaVCALENDAR10Long'
513 'Sound': [
514 'NokiaProfileLong',
515 'NokiaRingtone',
516 'NokiaRingtoneLong',
517 'EMSSound10',
518 'EMSSound12',
519 'EMSSonyEricssonSound',
520 'EMSSound10Long',
521 'EMSSound12Long',
522 'EMSSonyEricssonSoundLong',
524 'Animation': [
525 'NokiaProfileLong',
526 'EMSAnimation',
527 'AlcatelMonoAnimationLong',
528 'NokiaScreenSaverLong',
530 'File': [
531 'SiemensFile',
533 'Bitmap': [
534 'NokiaProfileLong',
535 'NokiaPictureImageLong',
536 'NokiaOperatorLogo',
537 'NokiaOperatorLogoLong',
538 'NokiaCallerLogo',
539 'EMSFixedBitmap',
540 'EMSVariableBitmap',
541 'EMSVariableBitmapLong',
542 'AlcatelMonoBitmapLong',
543 'AlcatelSMSTemplateName',
545 'PredefinedAnimation': [
546 'EMSPredefinedAnimation',
548 'PredefinedSound': [
549 'EMSPredefinedSound',
553 TextFormats = [
554 [(_('Alignment'), _('None')),
555 ('Left', _('Left'), '<div align="left">%s</div>'),
556 ('Right', _('Right'), '<div align="right">%s</div>'),
557 ('Center', _('Center'), '<div align="center">%s</div>'),
559 [(_('Text Size'), _('Normal')),
560 ('Large', _('Large'), '<font size="+2">%s</font>'),
561 ('Small', _('Small'), '<font size="-2">%s</font>'),
563 ['', ('Bold', _('Bold'), '<b>%s</b>')],
564 ['', ('Italic', _('Italic'), '<i>%s</i>')],
565 ['', ('Underlined', _('Underlined'), '<u>%s</u>')],
566 ['', ('Strikethrough', _('Strikethrough'), '<strike>%s</strike>')],
569 # dump from Gammu Phone Database
570 ManufacturerMap = {
571 'Alcatel': 1,
572 'Nokia': 2,
573 'Siemens': 3,
574 'Sony Ericsson': 4,
575 'Sagem': 5,
576 'Motorola': 6,
577 'Falcom': 7,
578 'Samsung': 8,
579 'LG': 9,
580 'Sharp': 10,
581 'Mitsubishi': 11,
582 'PalmOne': 12,
584 GarbleMap = {
585 0: 'atdot',
586 1: 'nospam',
587 2: 'none',
588 3: 'hide',
591 # Generated from http://standards.ieee.org/regauth/oui/oui.txt
592 MAC_Prefixes = {
593 'Sony-Ericsson' : [
594 '00:01:EC',
595 '00:0A:D9',
596 '00:0E:07',
597 '00:0F:DE',
598 '00:12:EE',
599 '00:15:E0',
600 '00:16:20',
601 '00:16:B8',
602 '00:18:13',
603 '00:19:63',
604 '00:1A:75',
605 '00:1B:59',
606 '00:1C:A4',
607 '00:1D:28',
608 '00:1E:45',
609 '00:80:37',
611 'Nokia' : [
612 '00:02:EE',
613 '00:0B:E1',
614 '00:0E:ED',
615 '00:0F:BB',
616 '00:10:B3',
617 '00:11:9F',
618 '00:12:62',
619 '00:13:70',
620 '00:13:FD',
621 '00:14:A7',
622 '00:15:2A',
623 '00:15:A0',
624 '00:15:DE',
625 '00:16:4E',
626 '00:16:BC',
627 '00:17:4B',
628 '00:17:B0',
629 '00:18:0F',
630 '00:18:42',
631 '00:18:8D',
632 '00:18:C5',
633 '00:19:2D',
634 '00:19:4F',
635 '00:19:79',
636 '00:19:B7',
637 '00:1A:16',
638 '00:1A:89',
639 '00:1A:DC',
640 '00:1B:33',
641 '00:1B:AF',
642 '00:1B:EE',
643 '00:1C:35',
644 '00:1C:9A',
645 '00:1C:D4',
646 '00:1C:D6',
647 '00:1D:3B',
648 '00:1D:6E',
649 '00:1D:98',
650 '00:1D:E9',
651 '00:1D:FD',
652 '00:1E:3A',
653 '00:1E:3B',
654 '00:1E:A3',
655 '00:1E:A4',
656 '00:40:43',
657 '00:A0:8E',
658 '00:E0:03',
660 'Siemens' : [
661 '00:01:E3',
662 '00:05:19',
663 '00:0B:23',
664 '00:0B:A3',
665 '00:0D:41',
666 '00:0E:8C',
667 '00:0F:BB',
668 '00:11:06',
669 '00:11:33',
670 '00:13:A3',
671 '00:18:D1',
672 '00:19:28',
673 '00:19:99',
674 '00:1A:D0',
675 '00:1A:E8',
676 '00:1B:1B',
677 '00:1C:06',
678 '00:30:05',
679 '00:50:07',
680 '00:90:40',
681 '00:C0:E4',
682 '08:00:06',
684 'Samsung' : [
685 '00:00:F0',
686 '00:02:78',
687 '00:09:18',
688 '00:0D:AE',
689 '00:0D:E5',
690 '00:0F:73',
691 '00:12:47',
692 '00:12:FB',
693 '00:13:77',
694 '00:15:99',
695 '00:15:B9',
696 '00:16:32',
697 '00:16:6B',
698 '00:16:6C',
699 '00:16:DB',
700 '00:17:C9',
701 '00:17:D5',
702 '00:18:AF',
703 '00:1A:8A',
704 '00:1B:98',
705 '00:1C:43',
706 '00:1D:25',
707 '00:1D:F6',
708 '00:1E:7D',
709 '00:E0:64',
711 'LG' : [
712 '00:05:C9',
713 '00:0B:29',
714 '00:12:56',
715 '00:14:80',
716 '00:19:A1',
717 '00:1C:62',
718 '00:1E:75',
719 '00:1E:B2',
720 '00:50:CE',
721 '00:E0:91',
723 'BenQ' : [
724 '00:03:9D',
725 '00:17:CA',
727 'Motorola' : [
728 '00:01:AF',
729 '00:04:56',
730 '00:04:BD',
731 '00:08:0E',
732 '00:0A:28',
733 '00:0B:06',
734 '00:0C:E5',
735 '00:0E:5C',
736 '00:0E:C7',
737 '00:0F:9F',
738 '00:11:1A',
739 '00:11:80',
740 '00:11:AE',
741 '00:12:25',
742 '00:12:8A',
743 '00:12:C9',
744 '00:13:71',
745 '00:14:04',
746 '00:14:9A',
747 '00:14:E8',
748 '00:15:2F',
749 '00:15:9A',
750 '00:15:A8',
751 '00:16:26',
752 '00:16:75',
753 '00:16:B5',
754 '00:17:00',
755 '00:17:84',
756 '00:17:E2',
757 '00:17:EE',
758 '00:18:A4',
759 '00:18:C0',
760 '00:19:2C',
761 '00:19:5E',
762 '00:19:A6',
763 '00:19:C0',
764 '00:1A:1B',
765 '00:1A:66',
766 '00:1A:77',
767 '00:1A:AD',
768 '00:1A:DB',
769 '00:1A:DE',
770 '00:1B:52',
771 '00:1B:DD',
772 '00:1C:11',
773 '00:1C:12',
774 '00:1C:C1',
775 '00:1C:FB',
776 '00:1D:6B',
777 '00:1D:BE',
778 '00:1E:46',
779 '00:1E:5A',
780 '00:1E:8D',
781 '00:20:40',
782 '00:20:75',
783 '00:A0:BF',
784 '00:C0:F9',
785 '00:E0:0C',
787 'Alcatel' : [
788 '00:07:72',
789 '00:08:9A',
790 '00:0E:86',
791 '00:0F:62',
792 '00:11:3F',
793 '00:11:8B',
794 '00:15:3F',
795 '00:16:4D',
796 '00:17:CC',
797 '00:19:8F',
798 '00:1A:F0',
799 '00:1C:8E',
800 '00:1D:4C',
801 '00:20:32',
802 '00:20:60',
803 '00:20:DA',
804 '00:80:21',
805 '00:80:39',
806 '00:80:9F',
807 '00:A0:81',
808 '00:C0:BE',
809 '00:D0:95',
810 '00:D0:F6',
811 '00:E0:B1',
812 '00:E0:DA',