-
Notifications
You must be signed in to change notification settings - Fork 8
/
generate_tables.py
1893 lines (1568 loc) · 84.2 KB
/
generate_tables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
DEBUG = False
if __name__ == "__main__" and not DEBUG:
print("Suppressing output of generate_tables.py")
def debug(*args, **kwargs):
if DEBUG:
print(*args, **kwargs)
import os
import sys
import re
import urllib.request
import urllib.error
import math
from collections import namedtuple
sys.path.append(os.path.join(os.path.split(__file__)[0], '../generators'))
from device_infos import DeviceInfo, brick_infos, bricklet_infos
lang = 'en'
ToolInfo = namedtuple('ToolInfo', 'display_name url_part')
tool_infos = \
[
ToolInfo('Brick Daemon', 'brickd'),
ToolInfo('Brick Viewer', 'brickv'),
ToolInfo('Brick Flash', 'brick_flash'),
ToolInfo('Brick Logger', 'brick_logger')
]
BindingsInfo = namedtuple('BindingsInfo', 'display_name url_part software_doc_suffix is_programming_language is_released has_authentication_example has_download misc_docs tutorial is_hardware_supported')
MiscDoc = namedtuple('miscdoc', 'html_link rst_link name_dict has_examples show_in_api_table')
bindings_infos = \
[
BindingsInfo(display_name={'en': 'C/C++', 'de': 'C/C++'},
url_part='c',
software_doc_suffix='C',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False),
MiscDoc('API_Bindings_{suffix}_iOS', 'api_bindings_{suffix}_ios', {'en': 'Usage (iOS)', 'de': 'Benutzung (iOS)'}, False, False)
],
tutorial={'en': 'https://www.cprogramming.com/',
'de': 'https://www.cprogramming.com/'}, # http://www.c-howto.de/
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'C/C++ for Microcontrollers', 'de': u'C/C++ für Mikrocontroller'},
url_part='uc',
software_doc_suffix='uC',
is_programming_language=True,
is_released=True,
has_authentication_example=False,
has_download=True,
misc_docs=[
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False),
MiscDoc('API_Bindings_{suffix}_HAL_Arduino', 'api_bindings_{suffix}_hal_arduino', {'en': 'HAL Arduino', 'de': 'HAL Arduino'}, True, True),
MiscDoc('API_Bindings_{suffix}_HAL_Arduino_ESP32', 'api_bindings_{suffix}_hal_arduino_esp32', {'en': 'HAL Arduino ESP32', 'de': 'HAL Arduino ESP32'}, True, True),
MiscDoc('API_Bindings_{suffix}_HAL_Arduino_ESP32_Brick', 'api_bindings_{suffix}_hal_arduino_esp32_brick', {'en': 'HAL Arduino ESP32 Brick', 'de': 'HAL Arduino ESP32 Brick'}, True, True),
MiscDoc('API_Bindings_{suffix}_HAL_Arduino_ESP32_Ethernet_Brick', 'api_bindings_{suffix}_hal_arduino_esp32_ethernet_brick', {'en': 'HAL Arduino ESP32 Ethernet Brick', 'de': 'HAL Arduino ESP32 Ethernet Brick'}, True, True),
MiscDoc('API_Bindings_{suffix}_HAL_Linux', 'api_bindings_{suffix}_hal_linux', {'en': 'HAL Linux', 'de': 'HAL Linux'}, True, True),
MiscDoc('API_Bindings_{suffix}_HAL_Raspberry_Pi', 'api_bindings_{suffix}_hal_raspberry_pi', {'en': 'HAL Raspberry Pi', 'de': 'HAL Raspberry Pi'}, True, True),
#MiscDoc('API_Bindings_{suffix}_HAL_STM32F0', 'api_bindings_{suffix}_hal_stm32f0', {'en': 'HAL STM32F0', 'de': 'HAL STM32F0'}, True, True),
],
tutorial={'en': 'https://www.cprogramming.com/',
'de': 'https://www.cprogramming.com/'}, # http://www.c-howto.de/
is_hardware_supported=lambda device_info: device_info.has_comcu),
BindingsInfo(display_name={'en': 'C#', 'de': 'C#'},
url_part='csharp',
software_doc_suffix='CSharp',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False),
MiscDoc('API_Bindings_{suffix}_Windows_Phone', 'api_bindings_{suffix}_windows_phone', {'en': 'Usage (Windows Phone)', 'de': 'Benutzung (Win Phone)'}, False, False)
],
tutorial={'en': 'https://csharp.net-tutorials.com/',
'de': 'https://csharp.net-tutorials.com/'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Delphi/Lazarus', 'de': 'Delphi/Lazarus'},
url_part='delphi',
software_doc_suffix='Delphi',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'http://www.delphibasics.co.uk/',
'de': 'https://www.delphi-treff.de/tutorials/grundlagen-tutorials/'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Go', 'de': 'Go'},
url_part='go',
software_doc_suffix='Go',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'https://tour.golang.org',
'de': 'https://tour.golang.org'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Java', 'de': 'Java'},
url_part='java',
software_doc_suffix='Java',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False),
MiscDoc('API_Bindings_{suffix}_Android', 'api_bindings_{suffix}_android', {'en': 'Usage (Android)', 'de': 'Benutzung (Android)'}, False, False)
],
tutorial={'en': 'https://docs.oracle.com/javase/tutorial/',
'de': 'https://docs.oracle.com/javase/tutorial/'}, # http://openbook.galileocomputing.de/javainsel/
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'JavaScript', 'de': 'JavaScript'},
url_part='javascript',
software_doc_suffix='JavaScript',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'LabVIEW', 'de': 'LabVIEW'},
url_part='labview',
software_doc_suffix='LabVIEW',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Mathematica', 'de': 'Mathematica'},
url_part='mathematica',
software_doc_suffix='Mathematica',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'MATLAB/Octave', 'de': 'MATLAB/Octave'},
url_part='matlab',
software_doc_suffix='MATLAB',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'MQTT', 'de': 'MQTT'},
url_part='mqtt',
software_doc_suffix='MQTT',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'openHAB', 'de': 'openHAB'},
url_part='openhab',
software_doc_suffix='openHAB',
is_programming_language=True,
is_released=True,
has_authentication_example=False,
has_download=False, # FIXME
misc_docs=[
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: device_info.has_openhab),
BindingsInfo(display_name={'en': 'Perl', 'de': 'Perl'},
url_part='perl',
software_doc_suffix='Perl',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'PHP', 'de': 'PHP'},
url_part='php',
software_doc_suffix='PHP',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'https://www.php.net/manual/en/getting-started.php',
'de': 'https://www.php.net/manual/de/getting-started.php'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Python', 'de': 'Python'},
url_part='python',
software_doc_suffix='Python',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'https://www.python.org/about/gettingstarted/', # http://getpython3.com/diveintopython3/
'de': 'https://www.python.org/about/gettingstarted/'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Ruby', 'de': 'Ruby'},
url_part='ruby',
software_doc_suffix='Ruby',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'https://www.ruby-lang.org/en/documentation/quickstart/',
'de': 'https://www.ruby-lang.org/de/documentation/quickstart/'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Rust', 'de': 'Rust'},
url_part='rust',
software_doc_suffix='Rust',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'https://doc.rust-lang.org/tutorial.html',
'de': 'https://doc.rust-lang.org/tutorial.html'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Shell', 'de': 'Shell'},
url_part='shell',
software_doc_suffix='Shell',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
#BindingsInfo(display_name={'en': 'Tinkerforge Visual Programming Language (TVPL)', 'de': 'Tinkerforge Visual Programming Language (TVPL)'},
# url_part='tvpl',
# software_doc_suffix='TVPL',
# is_programming_language=True,
# is_released=False,
# has_authentication_example=False,
# has_download=True,
# misc_docs=[
# ('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}),
# ('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'})
# ],
# tutorial={'en': 'FIXME',
# 'de': 'FIXME'}),
BindingsInfo(display_name={'en': 'Visual Basic .NET', 'de': 'Visual Basic .NET'},
url_part='vbnet',
software_doc_suffix='VBNET',
is_programming_language=True,
is_released=True,
has_authentication_example=True,
has_download=True,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'http://howtostartprogramming.com/vb-net/',
'de': 'http://howtostartprogramming.com/vb-net/'}, # http://openbook.galileocomputing.de/vb_net/index.htm
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'TCP/IP', 'de': 'TCP/IP'},
url_part='tcpip',
software_doc_suffix='TCPIP',
is_programming_language=False,
is_released=True,
has_authentication_example=False,
has_download=False,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
BindingsInfo(display_name={'en': 'Modbus', 'de': 'Modbus'},
url_part='modbus',
software_doc_suffix='Modbus',
is_programming_language=False,
is_released=True,
has_authentication_example=False,
has_download=False,
misc_docs=[
MiscDoc('IPConnection_{suffix}', 'ip_connection_{suffix}', {'en': 'IP Connection', 'de': 'IP Connection'}, True, True),
MiscDoc('API_Bindings_{suffix}', 'api_bindings_{suffix}', {'en': 'Usage', 'de': 'Benutzung'}, False, False)
],
tutorial={'en': 'FIXME',
'de': 'FIXME'},
is_hardware_supported=lambda device_info: True),
]
extension_infos = \
[
DeviceInfo(None, 'Extension', 'Chibi Extension', 'Chibi', 'chibi_extension', 'Chibi_Extension', None, 'chibi-extension', None, False, False, True, True, True, False, None,
{'en': 'Wireless Chibi connection between stacks',
'de': 'Drahtlose Chibi Verbindung zwischen Stapeln'}),
DeviceInfo(None, 'Extension', 'Ethernet Extension', 'Ethernet', 'ethernet_extension', 'Ethernet_Extension', None, 'ethernet-extension', None, False, False, True, True, False, False, None,
{'en': 'Cable based Ethernet connection between stack and PC',
'de': 'Kabelgebundene Ethernet Verbindung zwischen Stapel und PC'}),
DeviceInfo(None, 'Extension', 'RS485 Extension', 'RS485', 'rs485_extension', 'RS485_Extension', None, 'rs485-extension', None, False, False, True, True, False, False, None,
{'en': 'Cable based RS485 connection between stacks',
'de': 'Kabelgebundene RS485 Verbindung zwischen Stapeln'}),
DeviceInfo(None, 'Extension', 'WIFI Extension', 'WIFI', 'wifi_extension', 'WIFI_Extension', None, 'wifi-extension', None, False, False, True, True, False, False, None,
{'en': 'Wireless Wi-Fi connection between stack and PC',
'de': 'Drahtlose WLAN Verbindung zwischen Stapel und PC'}),
DeviceInfo(None, 'Extension', 'WIFI Extension 2.0', 'WIFI 2.0', 'wifi_v2_extension', 'WIFI_V2_Extension', None, 'wifi-v2-extension', 'wifi_v2', False, False, True, True, False, False, None,
{'en': 'Wireless Wi-Fi connection between stack and PC',
'de': 'Drahtlose WLAN Verbindung zwischen Stapel und PC'})
]
power_supply_infos = \
[
DeviceInfo(None, 'PowerSupply', 'Step-Down Power Supply', 'Step-Down', 'step_down_power_supply', 'Step_Down', None, 'step-down-powersupply', None, False, False, True, True, False, False, None,
{'en': 'Powers a stack of Bricks with 5V',
'de': 'Versorgt einen Stapel von Bricks mit 5V'}),
DeviceInfo(None, 'PowerSupply', 'ESP32 Power Supply', 'ESP32', 'esp32_power_supply', 'ESP32', None, 'esp32-power-supply', None, False, False, True, True, False, False, None,
{'en': 'Powers a ESP32 Brick or ESP32 Ethernet Brick with 5V',
'de': 'Versorgt einen ESP32 Brick oder ESP32 Ethernet Brick mit 5V'})
]
KitInfo = namedtuple('KitInfo', 'display_name url_part prefix released')
kit_infos = \
[
KitInfo({'en': 'Starter Kit: Blinkenlights', 'de': 'Starterkit: Blinkenlights'}, 'blinkenlights', 'starter_kit_', True),
KitInfo({'en': 'Starter Kit: Camera Slider', 'de': 'Starterkit: Kameraschlitten'}, 'camera_slider', 'starter_kit_', True),
KitInfo({'en': 'Tabletop Weather Station', 'de': 'Tisch-Wetterstation'}, 'tabletop_weather_station', '', True),
KitInfo({'en': 'Starter Kit: Weather Station', 'de': 'Starterkit: Wetterstation'}, 'weather_station', 'starter_kit_', True)
]
LATEST_VERSIONS_URL = 'https://download.tinkerforge.com/latest_versions.txt'
tool_versions = {}
bindings_versions = {}
firmware_versions = {}
plugin_versions = {}
extension_versions = {}
kit_versions = {}
red_image_versions = {}
has_examples = {}
def collect_latest_version_info():
debug('Discovering latest versions on tinkerforge.com')
try:
response = urllib.request.urlopen(LATEST_VERSIONS_URL)
latest_versions_data = response.read().decode('utf-8')
except urllib.error.URLError:
raise Exception('Latest version information on tinkerforge.com is not available (error code 1)')
for line in latest_versions_data.split('\n'):
line = line.strip()
if len(line) < 1:
continue
parts = line.split(':')
if len(parts) != 3:
raise Exception('Latest version information on tinkerforge.com is malformed (error code 2)')
latest_version_parts = parts[2].split('.')
if len(latest_version_parts) != 3:
raise Exception('Latest version information on tinkerforge.com is malformed (error code 3)')
try:
latest_version = int(latest_version_parts[0]), int(latest_version_parts[1]), int(latest_version_parts[2])
except:
raise Exception('Latest version information on tinkerforge.com is malformed (error code 4)')
if parts[0] == 'tools':
tool_versions[parts[1]] = latest_version
elif parts[0] == 'bindings':
bindings_versions[parts[1]] = latest_version
elif parts[0] == 'bricks':
firmware_versions[parts[1]] = latest_version
elif parts[0] == 'bricklets':
plugin_versions[parts[1]] = latest_version
elif parts[0] == 'extensions':
extension_versions[parts[1]] = latest_version
elif parts[0] == 'kits':
kit_versions[parts[1]] = latest_version
elif parts[0] == 'red_images':
red_image_versions[parts[1]] = latest_version
def collect_example_info(path):
for device_info in brick_infos + bricklet_infos:
if not device_info.has_bindings:
continue
assert device_info.identifier != None, device_info
has_examples[device_info.identifier] = {}
for bindings_info in bindings_infos:
if not bindings_info.is_programming_language:
continue
if not bindings_info.is_hardware_supported(device_info):
continue
assert bindings_info.url_part != None, bindings_info
category = device_info.category
if category.startswith('Brick'):
category += 's'
examples_label = '_{0}_{1}_examples'.format(device_info.ref_name, bindings_info.url_part)
doc_path = os.path.join(path, 'source', 'Software', category, '{0}_{1}.rst'.format(device_info.software_doc_prefix, bindings_info.software_doc_suffix))
if not os.path.exists(doc_path):
has_examples[device_info.identifier][bindings_info.url_part] = False
else:
with open(doc_path, 'r') as f:
has_examples[device_info.identifier][bindings_info.url_part] = examples_label in f.read()
def make_primer_table(device_infos):
table_head = {
'en': """
.. csv-table::
:header: "Name", "Description"
:widths: 25, 75
""",
'de': """
.. csv-table::
:header: "Name", "Beschreibung"
:widths: 25, 75
"""
}
row = ' ":ref:`{0} <{1}>`", "{2}"'
rows = []
for device_info in sorted(device_infos, key=lambda x: x.short_display_name.lower()):
if device_info.is_documented and not device_info.is_discontinued:
rows.append(row.format(device_info.short_display_name, device_info.ref_name, device_info.description[lang].replace('"', "inch")))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_discontinued_products_table():
table_head = {
'en': """
.. csv-table::
:header: "Name", "Description"
:delim: |
:widths: 25, 75
**Bricks** |
{0}
|
**Bricklets** |
{1}
|
**Master Extensions** |
{2}
""",
# FIXME
#"""
# |
# **Power Supplies** |
#{3}
# |
# **Accessories** |
#{4}
#"""
'de': """
.. csv-table::
:header: "Name", "Beschreibung"
:delim: |
:widths: 25, 75
**Bricks** |
{0}
|
**Bricklets** |
{1}
|
**Master Extensions** |
{2}
"""
# FIXME
#"""
# |
# **Stromversorgungen** |
#{3}
# |
# **Zubehör** |
#{4}
#"""
}
row = ' :ref:`{0} <{1}>` | {2}'
brick_rows = []
bricklet_rows = []
extension_rows = []
power_supply_rows = []
for brick_info in sorted(brick_infos, key=lambda x: x.short_display_name.lower()):
if brick_info.is_documented and brick_info.is_discontinued:
brick_rows.append(row.format(brick_info.short_display_name, brick_info.ref_name, brick_info.description[lang].replace('"', "inch")))
for bricklet_info in sorted(bricklet_infos, key=lambda x: x.short_display_name.lower()):
if bricklet_info.is_documented and bricklet_info.is_discontinued:
bricklet_rows.append(row.format(bricklet_info.short_display_name, bricklet_info.ref_name, bricklet_info.description[lang].replace('"', "inch")))
for extension_info in sorted(extension_infos, key=lambda x: x.short_display_name.lower()):
if extension_info.is_documented and extension_info.is_discontinued:
extension_rows.append(row.format(extension_info.short_display_name, extension_info.ref_name, extension_info.description[lang].replace('"', "inch")))
for power_supply_info in sorted(power_supply_infos, key=lambda x: x.short_display_name.lower()):
if power_supply_info.is_documented and power_supply_info.is_discontinued:
power_supply_rows.append(row.format(power_supply_info.short_display_name, power_supply_info.ref_name, power_supply_info.description[lang].replace('"', "inch")))
return table_head[lang].format('\n'.join(brick_rows),
'\n'.join(bricklet_rows),
'\n'.join(extension_rows),
'\n'.join(power_supply_rows))
def make_download_tools_table():
source_code = {
'en': 'Source Code',
'de': 'Quelltext'
}
archive = {
'en': 'Archive',
'de': 'Archiv'
}
table_head = {
'en': """.. csv-table::
:header: "Tool", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Tool", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row_brickd = ' :ref:`{0} <{1}>` | Linux (`amd64 <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_amd64.deb>`__, `i386 <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_i386.deb>`__, `armhf <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_armhf.deb>`__, `arm64 <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_arm64.deb>`__, `RED Brick <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}+redbrick_armhf.deb>`__), `Windows <https://download.tinkerforge.com/tools/{1}/windows/{1}_windows_{4}_{5}_{6}.exe>`__, `macOS <https://download.tinkerforge.com/tools/{1}/macos/{1}_macos_{4}_{5}_{6}.dmg>`__, `{2} <https://github.com/Tinkerforge/{1}/archive/v{4}.{5}.{6}.zip>`__ | {4}.{5}.{6} | `{3} <https://download.tinkerforge.com/tools/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{1}/master/src/changelog>`__'
row_brick_flash = ' :ref:`{0} <{1}>` | `Linux <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_all.deb>`__, `{2} <https://github.com/Tinkerforge/brickv/archive/brick-flash-{4}.{5}.{6}.zip>`__ | {4}.{5}.{6} | `{3} <https://download.tinkerforge.com/tools/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/brickv/master/src/changelog.brick-flash>`__'
row_brick_logger = ' :ref:`{0} <{1}>` | `Linux, Windows, macOS <https://download.tinkerforge.com/tools/{1}/{1}_{4}_{5}_{6}.zip>`__, `RED Brick <https://download.tinkerforge.com/tools/{1}/{1}_{4}_{5}_{6}.tfrba>`__, `{2} <https://github.com/Tinkerforge/brickv/archive/brick-logger-{4}.{5}.{6}.zip>`__ | {4}.{5}.{6} | `{3} <https://download.tinkerforge.com/tools/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/brickv/master/src/changelog.brick-logger>`__'
row_other = ' :ref:`{0} <{1}>` | `Linux <https://download.tinkerforge.com/tools/{1}/linux/{1}-{4}.{5}.{6}_all.deb>`__, `Windows <https://download.tinkerforge.com/tools/{1}/windows/{1}_windows_{4}_{5}_{6}.exe>`__, `macOS <https://download.tinkerforge.com/tools/{1}/macos/{1}_macos_{4}_{5}_{6}.dmg>`__, `{2} <https://github.com/Tinkerforge/{1}/archive/v{4}.{5}.{6}.zip>`__ | {4}.{5}.{6} | `{3} <https://download.tinkerforge.com/tools/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{1}/master/src/changelog>`__'
rows = []
for tool_info in tool_infos:
if tool_info.url_part == 'brickd':
row = row_brickd
elif tool_info.url_part == 'brick_flash':
row = row_brick_flash
elif tool_info.url_part == 'brick_logger':
row = row_brick_logger
else:
row = row_other
rows.append(row.format(tool_info.display_name,
tool_info.url_part,
source_code[lang],
archive[lang],
*tool_versions[tool_info.url_part]))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_bindings_table():
bindings_and_examples = {
'en': 'Bindings and Examples',
'de': 'Bindings und Beispiele'
}
archive = {
'en': 'Archive',
'de': 'Archiv'
}
table_head = {
'en': """.. csv-table::
:header: "Language", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Sprache", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' :ref:`{0} <api_bindings_{1}>` | `{3} <https://download.tinkerforge.com/bindings/{1}/tinkerforge_{1}_bindings_{4}_{5}_{6}.zip>`__ | {4}.{5}.{6} | `{2} <https://download.tinkerforge.com/bindings/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/generators/master/{1}/changelog.txt>`__'
rows = []
for bindings_info in bindings_infos:
if not bindings_info.is_released or not bindings_info.has_download:
continue
rows.append(row.format(bindings_info.display_name[lang],
bindings_info.url_part,
archive[lang],
bindings_and_examples[lang],
*bindings_versions[bindings_info.url_part]))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_red_images_table():
archive = {
'en': 'Archive',
'de': 'Archiv'
}
table_head = {
'en': """.. csv-table::
:header: "Type", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Typ", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' RED Brick Image | `Image <https://download.tinkerforge.com/red_images/{0}/red_image_{2}_{3}_{0}.img.7z>`__ | {2}.{3} | `{1} <https://download.tinkerforge.com/red_images/{0}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/red-brick/master/image/changelog_{0}>`__'
rows = []
for image in ['full']:
rows.append(row.format(image,
archive[lang],
*red_image_versions[image]))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_brick_firmwares_table():
archive = {
'en': 'Archive',
'de': 'Archiv'
}
source_code = {
'en': 'Source Code',
'de': 'Quelltext'
}
table_head = {
'en': """.. csv-table::
:header: "Brick", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Brick", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' :ref:`{0} <{1}>` | `Firmware <https://download.tinkerforge.com/firmwares/{6}s/{2}/{6}_{2}_firmware_{8}_{9}_{10}.{7}>`__, `{3} <https://github.com/Tinkerforge/{4}/archive/{11}{8}.{9}.{10}.zip>`__ | {8}.{9}.{10} | `{5} <https://download.tinkerforge.com/firmwares/{6}s/{2}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{4}/master/software/changelog{12}>`__'
rows = []
for brick_info in sorted(brick_infos, key=lambda x: x.short_display_name.lower()):
if brick_info.firmware_url_part != None and brick_info.is_documented:
if brick_info.has_comcu:
firmware_version = plugin_versions.get(brick_info.firmware_url_part, (0,0,0))
category = 'bricklet'
extension = 'zbin'
else:
firmware_version = firmware_versions.get(brick_info.firmware_url_part, (0,0,0))
category = 'brick'
extension = 'bin'
if brick_info.esp32_firmware != None:
git_name = 'esp32-firmware'
git_tag_prefix = brick_info.esp32_firmware + '-'
changelog_suffix = '_' + brick_info.esp32_firmware + '.txt'
else:
git_name = brick_info.git_name
git_tag_prefix = 'v'
changelog_suffix = ''
rows.append(row.format(brick_info.short_display_name,
brick_info.ref_name,
brick_info.firmware_url_part,
source_code[lang],
git_name,
archive[lang],
category,
extension,
firmware_version[0],
firmware_version[1],
firmware_version[2],
git_tag_prefix,
changelog_suffix))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_bricklet_plugins_table():
archive = {
'en': 'Archive',
'de': 'Archiv'
}
source_code = {
'en': 'Source Code',
'de': 'Quelltext'
}
table_head = {
'en': """.. csv-table::
:header: "Bricklet", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Bricklet", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' :ref:`{0} <{1}>` | `Plugin <https://download.tinkerforge.com/firmwares/bricklets/{2}/bricklet_{2}_firmware_{7}_{8}_{9}.{6}>`__, `{3} <https://github.com/Tinkerforge/{4}/archive/{10}{7}.{8}.{9}.zip>`__ | {7}.{8}.{9} | `{5} <https://download.tinkerforge.com/firmwares/bricklets/{2}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{4}/master/software/changelog{11}>`__'
rows = []
for bricklet_info in sorted(bricklet_infos, key=lambda x: x.short_display_name.lower()):
if bricklet_info.firmware_url_part != None and bricklet_info.is_documented:
subversion = []
if bricklet_info.firmware_url_part == 'lcd_20x4':
subversion.append((bricklet_info.short_display_name + ' 1.1', bricklet_info.firmware_url_part + '_v11'))
subversion.append((bricklet_info.short_display_name + ' 1.2', bricklet_info.firmware_url_part + '_v12'))
else:
subversion.append((bricklet_info.short_display_name, bricklet_info.firmware_url_part))
if bricklet_info.esp32_firmware != None:
git_name = 'esp32-firmware'
git_tag_prefix = bricklet_info.esp32_firmware + '-'
changelog_suffix = '_' + bricklet_info.esp32_firmware + '.txt'
else:
git_name = bricklet_info.git_name
git_tag_prefix = 'v'
changelog_suffix = ''
for short_display_name, firmware_url_part in subversion:
plugin_version = plugin_versions.get(firmware_url_part, (0, 0, 0))
rows.append(row.format(short_display_name,
bricklet_info.ref_name,
firmware_url_part,
source_code[lang],
git_name,
archive[lang],
'zbin' if bricklet_info.has_comcu else 'bin',
plugin_version[0],
plugin_version[1],
plugin_version[2],
git_tag_prefix,
changelog_suffix))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_extension_firmwares_table():
archive = {
'en': 'Archive',
'de': 'Archiv'
}
source_code = {
'en': 'Source Code',
'de': 'Quelltext'
}
table_head = {
'en': """.. csv-table::
:header: "Brick", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Brick", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' :ref:`{0} <{1}>` | `Firmware <https://download.tinkerforge.com/firmwares/extensions/{2}/extension_{2}_firmware_{6}_{7}_{8}.zbin>`__, `{3} <https://github.com/Tinkerforge/{4}/archive/v{6}.{7}.{8}.zip>`__ | {6}.{7}.{8} | `{5} <https://download.tinkerforge.com/firmwares/extensions/{2}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{4}/master/software/changelog>`__'
rows = []
for extension_info in sorted(extension_infos, key=lambda x: x.short_display_name.lower()):
if extension_info.firmware_url_part != None and extension_info.is_documented:
extension_version = extension_versions.get(extension_info.firmware_url_part, (0,0,0))
rows.append(row.format(extension_info.short_display_name,
extension_info.ref_name,
extension_info.firmware_url_part,
source_code[lang],
extension_info.git_name,
archive[lang],
*extension_version))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_download_kits_table():
source_code = {
'en': 'Source Code',
'de': 'Quelltext'
}
archive = {
'en': 'Archive',
'de': 'Archiv'
}
table_head = {
'en': """.. csv-table::
:header: "Kit", "Downloads", "Version", "Archive", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
""",
'de': """.. csv-table::
:header: "Kit", "Downloads", "Version", "Archiv", "Changelog"
:delim: |
:widths: 22, 55, 7, 7, 9
"""
}
row = ' :ref:`{0} <{5}{1}>` | `Linux <https://download.tinkerforge.com/kits/{1}/linux/{6}{2}-demo-{7}.{8}.{9}_all.deb>`__, `Windows <https://download.tinkerforge.com/kits/{1}/windows/{5}{1}_demo_windows_{7}_{8}_{9}.exe>`__, `macOS <https://download.tinkerforge.com/kits/{1}/macos/{5}{1}_demo_macos_{7}_{8}_{9}.dmg>`__, `{3} <https://github.com/Tinkerforge/{2}/archive/demo-{7}.{8}.{9}.zip>`__ | {7}.{8}.{9} | `{4} <https://download.tinkerforge.com/kits/{1}/>`__ | `Changelog <https://raw.githubusercontent.com/Tinkerforge/{2}/master/demo/changelog>`__'
rows = []
for kit_info in kit_infos:
if not kit_info.released:
continue
rows.append(row.format(kit_info.display_name[lang],
kit_info.url_part,
kit_info.url_part.replace('_', '-'),
source_code[lang],
archive[lang],
kit_info.prefix,
kit_info.prefix.replace('_', '-'),
*kit_versions[kit_info.url_part]))
return table_head[lang] + '\n'.join(rows) + '\n'
def make_api_bindings_links_table(bindings_info):
table_head = {
'en': """.. csv-table::
:header: "Name", "API", "Examples"
:delim: |
:widths: 20, 10, 10
{0}
""",
'de': """.. csv-table::
:header: "", "API", "Beispiele"
:delim: |
:widths: 20, 10, 10
{0}
"""
}
misc_with_examples_row = {
'en': ' :ref:`{0} <{1}>` | :ref:`API <{1}_api>` | :ref:`Examples <{1}_examples>`',
'de': ' :ref:`{0} <{1}>` | :ref:`API <{1}_api>` | :ref:`Beispiele <{1}_examples>`'
}
misc_without_examples_row = {
'en': ' :ref:`{0} <{1}>` | :ref:`API <{1}_api>` |',
'de': ' :ref:`{0} <{1}>` | :ref:`API <{1}_api>` |'
}
device_with_examples_row = {
'en': ' :ref:`{2} <{0}>` | :ref:`API <{0}_{1}_api>` | :ref:`Examples <{0}_{1}_examples>`',
'de': ' :ref:`{2} <{0}>` | :ref:`API <{0}_{1}_api>` | :ref:`Beispiele <{0}_{1}_examples>`'
}
device_without_examples_row = {
'en': ' :ref:`{2} <{0}>` | :ref:`API <{0}_{1}_api>` |',
'de': ' :ref:`{2} <{0}>` | :ref:`API <{0}_{1}_api>` |'
}
brick_lines = [[], []]
for brick_info in sorted(brick_infos, key=lambda x: x.short_display_name.lower()):
if not brick_info.is_documented or not brick_info.has_bindings:
continue
if not bindings_info.is_hardware_supported(brick_info):
continue
if has_examples[brick_info.identifier][bindings_info.url_part]:
device_row = device_with_examples_row
else:
device_row = device_without_examples_row
line = device_row[lang].format(brick_info.ref_name, bindings_info.url_part, brick_info.short_display_name)
if not brick_info.is_discontinued:
brick_lines[0].append(line)
else:
brick_lines[1].append(line)
bricklet_lines = [[], []]
for bricklet_info in sorted(bricklet_infos, key=lambda x: x.short_display_name.lower()):
if not bricklet_info.is_documented or not bricklet_info.has_bindings:
continue
if not bindings_info.is_hardware_supported(bricklet_info):
continue
if has_examples[bricklet_info.identifier][bindings_info.url_part]:
device_row = device_with_examples_row
else:
device_row = device_without_examples_row
line = device_row[lang].format(bricklet_info.ref_name, bindings_info.url_part, bricklet_info.short_display_name)