-
Notifications
You must be signed in to change notification settings - Fork 1
/
ms-CEESpring2020.py
1601 lines (1397 loc) · 110 KB
/
ms-CEESpring2020.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/python
# -*- coding: utf-8 -*-
"""
Call:
python pwb.py masti/ms-CEESpring2020.py -page:"Szablon:CEE Spring 2020" -outpage:"meta:Wikimedia CEE Spring 2020/Statistics" -summary:"Bot updates statistics" -reset -progress -pt:0
python pwb.py masti/ms-CEESpring2020.py -page:"Szablon:CEE Spring 2020" -outpage:"Wikipedysta:Masti/CEE Spring 2020" -summary:"Bot updates statistics" -reset -progress -pt:0
Use global -simulate option for test purposes. No changes to live wiki
will be done.
The following parameters are supported:
¶ms;
-always If used, the bot won't ask if it should file the message
onto user talk page.
-outpage Results page; otherwise "Wikipedysta:mastiBot/test" is used
-maxlines Max number of entries before new subpage is created; default 1000
-text: Use this text to be added; otherwise 'Test' is used
-replace: Dont add text but replace it
-top Place additional text on top of the page
-summary: Set the action summary message for the edit.
-negative: mark if text not in page
-v: make verbose output
-vv: make even more verbose output
"""
#
# (C) Pywikibot team, 2006-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: c1795dd2fb2de670c0b4bddb289ea9d13b1e9b3f $'
#
import pywikibot
from pywikibot import pagegenerators
import re
from pywikibot import textlib
from datetime import datetime
import pickle
from pywikibot import (
config, config2,
)
from pywikibot.bot import (
MultipleSitesBot, ExistingPageBot, NoRedirectPageBot, AutomaticTWSummaryBot)
#SingleSiteBot, ExistingPageBot, NoRedirectPageBot, AutomaticTWSummaryBot)
from pywikibot.tools import issue_deprecation_warning
# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
'¶ms;': pagegenerators.parameterHelp
}
CEEtemplates = {'pl' : 'Szablon:CEE Spring 2020', 'az' : 'Şablon:Vikibahar 2020', 'ba' : 'Ҡалып:Вики-яҙ 2020', 'be' : 'Шаблон:CEE Spring 2020', 'be-tarask' : 'Шаблён:Артыкул ВікіВясны-2020', 'bg' : 'Шаблон:CEE Spring 2020', 'de' : 'Vorlage:CEE Spring 2020', 'eo':'Ŝablono:VikiPrintempo COE 2020', 'el' : 'Πρότυπο:CEE Spring 2020', 'et' : 'Mall:CEE Spring 2020', 'hr' : 'Predložak:CEE proljeće 2020.', 'hu':'Sablon:CEE Tavasz 2020', 'hy' : 'Կաղապար:CEE Spring 2020', 'ka' : 'თარგი:ვიკიგაზაფხული 2020', 'lv' : 'Veidne:CEE Spring 2020', 'lt' : 'Šablonas:VRE 2020', 'mk' : 'Шаблон:СИЕ Пролет 2020', 'myk':'Шаблон:СИЕ Пролет 2020', 'ro' : 'Format:Wikimedia CEE Spring 2020', 'ru' : 'Шаблон:Вики-весна 2020', 'sr' : 'Шаблон:ЦЕЕ пролеће 2020', 'tr' : 'Şablon:Vikibahar 2020', 'uk' : 'Шаблон:CEE Spring 2020' }
countryList =[ u'Albania', u'Armenia', u'Austria', u'Azerbaijan', u'Bashkortostan', u'Belarus', u'Bosnia and Herzegovina', u'Bulgaria', u'Crimean Tatars', u'Don', u'Croatia', u'Czechia', u'Erzia', u'Esperanto', u'Estonia', u'Georgia', u'Greece', u'Hungary', u'Kazakhstan', u'Kosovo', u'Latvia', u'Lithuania', u'North Macedonia', u'Malta', u'Montenegro', u'Poland', u'Romania and Moldova', u'Republic of Srpska', u'Russia', u'Serbia', u'Sorbia', u'Slovakia', u'Slovenia', u'Tatarstan', u'Turkey', u'Ukraine', u'Other', u'Empty' ]
languageCountry = { 'el':'Greece', 'eo':'Esperanto', 'myv':'Erzia', 'bg':'Bulgaria', 'et':'Estonia', 'az':'Azerbaijan', 'ru':'Russia', 'tt':'Tatarstan', 'tr':'Turkey', 'lv':'Latvia', 'ro':'Romania and Moldova', 'pl':'Poland', 'hy':'Armenia', 'ba':'Bashkortostan', 'hr':'Croatia', 'de':'Germany', 'hu':'Hungary', 'kk':'Kazakhstan', 'sr':'Serbia', 'sq':'Albania', 'mk':'North Macedonia', 'sk':'Slovakia', 'mt':'Malta', 'be-tarask':'Belarus', 'uk':'Ukraine', 'sl':'Slovenia' }
countryNames = {
#pl countries
'pl':{ 'Albania':'Albania', 'Austria':'Austria', 'Azerbejdżan':'Azerbaijan', 'Baszkortostan':'Bashkortostan', 'Białoruś':'Belarus', 'Bułgaria':'Bulgaria', 'Armenia':'Armenia', 'Bośnia i Hercegowina':'Bosnia and Herzegovina', 'Czarnogóra':'Montenegro', 'Erzja':'Erzia', 'Esperanto':'Esperanto', 'Estonia':'Estonia', 'Gruzja':'Georgia', 'Czechy':'Czechia', 'Chorwacja':'Croatia', 'Kosowo':'Kosovo', 'Tatarzy krymscy':'Crimean Tatars', 'Litwa':'Lithuania', 'Łotwa':'Latvia', 'Łużyce':'Sorbia', 'Malta':'Malta', 'Węgry':'Hungary', 'Macedonia Północna':'North Macedonia', 'Macedonia':'North Macedonia', 'Mołdawia':'Romania and Moldova', 'Polska':'Poland', 'Region doński':'Don', 'Rosja':'Russia', 'Rumunia':'Romania and Moldova', 'Republika Serbska':'Republic of Srpska', 'Serbia':'Serbia', 'Serbołużyczanie':'Sorbia', 'Słowacja':'Slovakia', 'Słowenia':'Slovenia', 'Turcja':'Turkey', 'Ukraina':'Ukraine', 'Grecja':'Greece', 'Kazachstan':'Kazakhstan', 'Tatarstan':'Tatarstan'},
#az countries
'az':{ 'Albaniya':'Albania', 'Avstriya':'Austria', 'Azərbaycan':'Azerbaijan', 'Başqırdıstan':'Bashkortostan', 'Belarus':'Belarus', 'Bolqarıstan':'Bulgaria', 'Ermənistan':'Armenia', 'Bosniya və Herseqovina':'Bosnia and Herzegovina', 'Erzya':'Erzia', 'Esperantida':'Esperanto', 'Estoniya':'Estonia', 'Gürcüstan':'Georgia', 'Çexiya':'Czechia', 'Xorvatiya':'Croatia', 'Kosovo':'Kosovo', 'Krımtatar':'Crimean Tatars', 'Krım tatarları':'Crimean Tatars', 'Krım-Tatar':'Crimean Tatars', 'Litva':'Lithuania', 'Latviya':'Latvia', 'Macarıstan':'Hungary', 'Şimali Makedoniya':'North Macedonia', 'Makedoniya':'North Macedonia', 'Malta':'Malta', 'Monteneqro':'Montenegro', 'Moldova':'Romania and Moldova', 'Polşa':'Poland', 'Rusiya':'Russia', 'Rumıniya':'Romania and Moldova', 'Serb Respublikası':'Republic of Srpska', 'Serbiya':'Serbia', 'Slovakiya':'Slovakia', 'Sloveniya':'Slovenia', 'Tatarıstan':'Tatarstan', 'Türkiyə':'Turkey', 'Ukrayna':'Ukraine', 'Yunanıstan':'Greece', 'Qazaxıstan':'Kazakhstan', 'Krım-tatarlar':'Crimean Tatars', 'Don regionu':'Don', 'Sorblar':'Sorbia', 'Esperanto':'Esperanto', },
#ba countries
'ba':{ 'Албания':'Albania', 'Австрия':'Austria', 'Әзербайжан':'Azerbaijan', 'Башҡортостан':'Bashkortostan', 'Белоруслаштырыу':'Belarus', 'Белоруссия':'Belarus', 'Беларусь':'Belarus', 'Белорусь':'Belarus', 'Болгария':'Bulgaria', 'Әрмәнстан':'Armenia', 'Босния һәм Герцоговина':'Bosnia and Herzegovina', 'Босния һәм Герцеговина':'Bosnia and Herzegovina', 'Дон':'Don', 'Эрзя теле':'Erzia', 'Эрзя':'Erzia', 'Эсперантида':'Esperanto', 'Эсперанто теле':'Esperanto', 'Эстония':'Estonia', 'Грузия':'Georgia', 'Чехия':'Czechia', 'Чех Республикаһы':'Czechia', 'Хорватия':'Croatia', 'Косово':'Kosovo', 'Ҡырым татар теле':'Crimean Tatars', 'Ҡырым Республикаһы':'Crimean Tatars', 'Ҡырым татарҙары':'Crimean Tatars', 'Литва':'Lithuania', 'Латвия':'Latvia', 'Венгрия':'Hungary', 'Черногория':'Montenegro', 'Төньяҡ Македония':'North Macedonia', 'Македония':'North Macedonia', 'Молдавия':'Romania and Moldova', 'Румыния һәм Молдова':'Romania and Moldova', 'Румыния һәм Молдова':'Romania and Moldova', 'Польша':'Poland', 'Рәсәй':'Russia', 'Рәсәй Федерацияһы':'Russia', 'Молдова':'Romania and Moldova', 'Румыния һәм Молдова':'Romania and Moldova', 'Румыния':'Romania and Moldova', 'Лужи теле':'Sorbia', 'Серб Республикаһы':'Republic of Srpska', 'Сербия':'Serbia', 'Словакия':'Slovakia', 'Словак социалистик республикаһы':'Slovakia', 'Словения':'Slovenia', 'Татарстан':'Tatarstan', 'Төркиә':'Turkey', 'Украина':'Ukraine', 'Греция':'Greece', 'Ҡаҙағстан':'Kazakhstan', 'Мальта':'Malta', 'Ҡырым':'Crimean Tatars', 'Эсперанто':'Esperanto', },
#be countries
'be':{ 'Албанія':'Albania', 'Аўстрыя':'Austria', 'Азербайджан':'Azerbaijan', 'Башкартастан':'Bashkortostan', 'Беларусь':'Belarus', 'Балгарыя':'Bulgaria', 'Арменія':'Armenia', 'Боснія і Герцагавіна':'Bosnia and Herzegovina', 'Чарнагорыя':'Montenegro', 'Эрзя':'Erzia', 'Эсперанта':'Esperanto', 'Эстонія':'Estonia', 'Грузія':'Georgia', 'Чэхія':'Czechia', 'Харватыя':'Croatia', 'Рэспубліка Косава':'Kosovo', 'Крымскія татары':'Crimean Tatars', 'Літва':'Lithuania', 'Латвія':'Latvia', 'Венгрыя':'Hungary', 'Македонія':'North Macedonia', 'Малдова':'Romania and Moldova', 'Польшча':'Poland', 'Расія':'Russia', 'Румынія':'Romania and Moldova', 'Рэспубліка Сербская':'Republic of Srpska', 'Сербія':'Serbia', 'Лужычане':'Sorbia', 'Славакія':'Slovakia', 'Татарстан':'Tatarstan', 'Турцыя':'Turkey', 'Украіна':'Ukraine', 'Грэцыя':'Greece', 'Казахстан':'Kazakhstan', },
#be-tarask countries
'be-tarask':{ 'Альбанія':'Albania', 'Аўстрыя':'Austria', 'Азэрбайджан':'Azerbaijan', 'Башкартастан':'Bashkortostan', 'Беларусь':'Belarus', 'Баўгарыя':'Bulgaria', 'Армэнія':'Armenia', 'Босьнія і Герцагавіна':'Bosnia and Herzegovina', 'Дон':'Don', 'Эрзя':'Erzia', 'Эспэранта':'Esperanto', 'Эстонія':'Estonia', 'Грузія':'Georgia', 'Чэхія':'Czechia', 'Харватыя':'Croatia', 'Косава':'Kosovo', 'крымскія татары':'Crimean Tatars', 'Крымскія татары':'Crimean Tatars', 'Летува':'Lithuania', 'Латвія':'Latvia', 'Вугоршчына':'Hungary', 'Паўночная Македонія':'North Macedonia', 'Македонія':'North Macedonia', 'Северна Македония':'North Macedonia', 'Малдова':'Romania and Moldova', 'Чарнагорыя':'Montenegro', 'Польшча':'Poland', 'Расея':'Russia', 'Румынія':'Romania and Moldova', 'Малодва':'Romania and Moldova', 'Рэспубліка Сэрбская':'Republic of Srpska', 'Сэрбія':'Serbia', 'Славаччына':'Slovakia', 'Славенія':'Slovenia', 'Нямеччына (лужычане)':'Sorbia', 'Лужычане':'Sorbia', 'Расея (Татарстан)':'Tatarstan', 'Татарстан':'Tatarstan', 'Турэччына':'Turkey', 'Украіна':'Ukraine', 'Грэцыя':'Greece', 'Казахстан':'Kazakhstan', 'Мальта':'Malta', 'эспэранта':'Esperanto', 'Republika srbská':'Republic of Srpska', 'Tatársko':'Tatarstan', },
#bg countries
'bg':{ 'Албания':'Albania', 'Австрия':'Austria', 'Азербайджан':'Azerbaijan', 'Башкортостан':'Bashkortostan', 'Беларус':'Belarus', 'България':'Bulgaria', 'Армения':'Armenia', 'Босна и Херцеговина':'Bosnia and Herzegovina', 'кримските татари':'Crimean Tatars', 'Донски регион':'Don', 'Ерзяни':'Erzia','ерзяни':'Erzia','Эрзя':'Erzia', 'Eсперанто':'Esperanto', 'Есперанто':'Esperanto', 'Естония':'Estonia', 'Грузия':'Georgia', 'Чехия':'Czechia', 'Хърватия':'Croatia', 'Косово':'Kosovo', 'кримски татари':'Crimean Tatars', 'Кримски татари':'Crimean Tatars', 'Литва':'Lithuania', 'Латвия':'Latvia', 'Унгария':'Hungary', 'Република Македония':'North Macedonia', 'Македония':'North Macedonia', 'Северна Македония':'North Macedonia', 'Молдова':'Romania and Moldova', 'Полша':'Poland', 'Русия':'Russia', 'Румъния и Молдова':'Romania and Moldova', 'Румъния':'Romania and Moldova', 'Черна гора':'Montenegro', 'Република Сръбска':'Republic of Srpska', 'Сърбия':'Serbia', 'Словакия':'Slovakia', 'Словения':'Slovenia', 'Лужичани (сорби)':'Sorbia', 'Турция':'Turkey', 'Украйна':'Ukraine', 'Гърция':'Greece', 'Казахстан':'Kazakhstan', 'Татарстан':'Tatarstan', 'Азербайджан':'Azerbaijan', 'лужичаните':'Sorbia', 'Малта':'Malta', 'ерзяните':'Erzia', 'есперанто':'Esperanto', },
#de countries
'de':{ 'Albanien':'Albania', 'Österreich':'Austria', 'Aserbaidschan':'Azerbaijan', 'Baschkortostan':'Bashkortostan', 'Weißrussland':'Belarus', 'Bulgarien':'Bulgaria', 'Armenien':'Armenia', 'Bosnien und Herzegowina':'Bosnia and Herzegovina', 'Don-Region':'Don', 'Ersja':'Erzia', 'Esperanto':'Esperanto', 'Estland':'Estonia', 'Georgien':'Georgia', 'Tschechien':'Czechia', 'Kroatien':'Croatia', 'Kosovo':'Kosovo', 'Krimtataren':'Crimean Tatars', 'Litauen':'Lithuania', 'Lettland':'Latvia', 'Ungarn':'Hungary', 'Mazedonien':'North Macedonia', 'Montenegro':'Montenegro', 'Moldau':'Romania and Moldova', 'Moldawien':'Romania and Moldova', 'Polen':'Poland', 'Russland':'Russia', 'Rumänien':'Romania and Moldova', 'Republik Moldau':'Romania and Moldova', 'Republika Srpska':'Republic of Srpska', 'Serbien':'Serbia', 'Slowakei':'Slovakia', 'Slowenien':'Slovenia', 'Türkei':'Turkey', 'Ukraine':'Ukraine', 'Griechenland':'Greece', 'Kasachstan':'Kazakhstan', 'Malta':'Malta', 'Sorbisches Siedlungsgebiet':'Sorbia', 'Nordmazedonien':'North Macedonia', 'Tatarstan':'Tatarstan', 'die Republik Moldau':'Romania and Moldova', },
#crh countries
'crh':{ 'Arnavutlıq':'Albania', 'Avstriya':'Austria', 'Azerbaycan':'Azerbaijan', 'Başqırtistan':'Bashkortostan', 'Belarus':'Belarus', 'Bulğaristan':'Bulgaria', 'Ermenistan':'Armenia', 'Bosna ve Hersek':'Bosnia and Herzegovina', 'Esperanto':'Esperanto', 'Estoniya':'Estonia', 'Gürcistan':'Georgia', 'Çehiya':'Czechia', 'Hırvatistan':'Croatia', 'Kosovo':'Kosovo', 'Qırımtatarlar':'Crimean Tatars', 'Litvaniya':'Lithuania', 'Latviya':'Latvia', 'Macaristan':'Hungary', 'Makedoniya':'North Macedonia', 'Moldova':'Romania and Moldova', 'Lehistan':'Poland', 'Rusiye':'Russia', 'Romaniya':'Romania and Moldova', 'Sırb Cumhuriyeti':'Republic of Srpska', 'Sırbistan':'Serbia', 'Slovakiya':'Slovakia', 'Türkiye':'Turkey', 'Ukraina':'Ukraine', 'Yunanistan':'Greece', 'Qazahistan':'Kazakhstan', },
#el countries
'el':{ 'Αλβανία':'Albania', 'Αυστρία':'Austria', 'Αζερμπαϊτζάν':'Azerbaijan', 'Μπασκορτοστάν':'Bashkortostan', 'Λευκορωσία':'Belarus', 'Βουλγαρία':'Bulgaria', 'Αρμενία':'Armenia', 'Βοσνία':'Bosnia and Herzegovina', 'Βοσνία-Ερζεγοβίνη':'Bosnia and Herzegovina', 'Βοσνία Ερζεγοβίνη':'Bosnia and Herzegovina', 'Βοσνία και Ερζεγοβίνη':'Bosnia and Herzegovina', 'Έρζυα':'Erzia', 'Εσπεράντο':'Esperanto', 'Εσθονία':'Estonia', 'Γεωργία':'Georgia', 'Τσεχία':'Czechia', 'Κροατία':'Croatia', 'Περιοχή του Ντον':'Don', 'Κοσσυφοπέδιο':'Kosovo', 'Κόσοβο':'Kosovo', 'Τατάροι Κριμαίας':'Crimean Tatars', 'Λιθουανία':'Lithuania', 'Λετονία':'Latvia', 'Ουγγαρία':'Hungary', 'Μαυροβούνιο':'Montenegro', 'πΓΔΜ':'North Macedonia', 'Βόρεια Μακεδονία':'North Macedonia', 'Ρουμανία & Μολδαβία':'Romania and Moldova', 'Μολδαβία':'Romania and Moldova', 'Πολωνία':'Poland', 'Ρωσική Ομοσπονδία':'Russia', 'Ρωσία':'Russia', 'Ρουμανία-Μολδαβία':'Romania and Moldova', 'Ρουμανία':'Romania and Moldova', 'Δημοκρατία της Σερβίας':'Republic of Srpska', 'Σερβική Δημοκρατία':'Republic of Srpska', 'Σερβία':'Serbia', 'Σορβικά':'Sorbia', 'Σορβία':'Sorbia', 'Σλοβακία':'Slovakia', 'Σλοβενία':'Slovenia', 'Ταταρστάν':'Tatarstan', 'Τουρκία':'Turkey', 'Ουκρανία':'Ukraine', 'Ελλάδα':'Greece', 'Καζακστάν':'Kazakhstan', 'Μάλτα':'Malta', 'Ταταρικά Κριμαίας':'Crimean Tatars', 'Σερβική Δημοκρατία της Βοσνίας':'Republic of Srpska', 'Σλοβενία χώρα':'Slovenia', },
#myv countries
'myv':{ 'Албания':'Albania', 'Албания Мастор':'Albania', 'Австрия Мастор':'Austria', 'Австрия':'Austria', 'Азербайджан Республикась':'Azerbaijan', 'Азербайджан':'Azerbaijan Мастор', 'Азербайджан':'Azerbaijan', 'Башкирия Республикась':'Bashkortostan', 'Башкирия Мастор':'Bashkortostan', 'Белорузия Республикась':'Belarus', 'Белорузия Мастор':'Belarus', 'Болгария Мастор':'Bulgaria', 'Армения Мастор':'Armenia', 'Босния ды Герцеговина Мастор':'Bosnia and Herzegovina', 'Босния ды Герцеговина':'Bosnia and Herzegovina', 'Эрзянь Мастор':'Erzia', 'Эрзя Мастор':'Erzia', 'Эсперанто':'Esperanto', 'Эстэнь Мастор':'Estonia', 'Эстэнь Мастор':'Estonia', 'Грузия Мастор':'Georgia', 'Чехия Мастор':'Czechia', 'Хорватия Мастор':'Croatia', 'Хорватия':'Croatia', 'Косово Мастор':'Kosovo', 'Литва Мастор':'Lithuania', 'Литва':'Lithuania', 'Латвия Мастор':'Latvia', 'Мадяронь Мастор':'Hungary', 'Мадьяронь Мастор':'Hungary', 'Македония Мастор':'North Macedonia', 'Македония':'North Macedonia', 'Молдавия':'Romania and Moldova', 'Румыния Мастор':'Romania and Moldova', 'Польша Мастор':'Poland', 'Польша':'Poland', 'Россия':'Russia', 'Россия Мастор':'Russia', 'Румыния Мастор':'Romania and Moldova', 'Сербань Республикась':'Republic of Srpska', 'Сербия Мастор':'Serbia', 'Сербия':'Serbia', 'Словакия Мастор':'Slovakia', 'Словакия':'Slovakia', 'Татаронь Республикась':'Tatarstan', 'Турция Мастор':'Turkey', 'Украина':'Ukraine', 'Украина Мастор':'Ukraine', 'Греция Мастор':'Greece', 'Казахстан Мастор':'Kazakhstan', 'Словения Мастор':'Slovenia', 'Мальта Мастор':'Malta', 'Молдавия Мастор':'Romania and Moldova', },
#eo countries
'eo':{ 'Albanio':'Albania', 'Aŭstrio':'Austria', 'Azerbajĝano':'Azerbaijan', 'Baŝkirio':'Bashkortostan', 'Belorusio':'Belarus', 'Bulgario':'Bulgaria', 'Armenio':'Armenia', 'Bosnio kaj Hercegovino':'Bosnia and Herzegovina', 'Erzja':'Erzia', 'Esperantujo':'Esperanto', 'Esperanto':'Esperanto', 'Estonio':'Estonia', 'Kartvelio':'Georgia', 'Ĉeĥio':'Czechia', 'Kroatio':'Croatia', 'Kosovo':'Kosovo', 'Krimeo':'Crimean Tatars', 'Krime-tataroj':'Crimean Tatars', 'Litovio':'Lithuania', 'Latvio':'Latvia', 'Hungario':'Hungary', 'Makedonio':'North Macedonia', 'Moldava':'Romania and Moldova', 'Montenegro':'Montenegro', 'Pollando':'Poland', 'Rusio':'Russia', 'Rumanio':'Romania and Moldova', 'Serba Respubliko':'Republic of Srpska', 'Serbio':'Serbia', 'Slovakio':'Slovakia', 'Turkio':'Turkey', 'Ukrainio':'Ukraine', 'Grekio':'Greece', 'Kazaĥio':'Kazakhstan', 'Moldavio':'Romania and Moldova', 'Ukraino':'Ukraine', 'Slovenio':'Slovenia', },
#hy countries
'hy':{ 'Ալբանիա':'Albania', 'Ավստրիա':'Austria', 'Ադրբեջան':'Azerbaijan', 'Ադրբեջանական Հանրապետություն':'Azerbaijan', 'Բաշկորտոստան':'Bashkortostan', 'Բելառուս':'Belarus', 'Բուլղարիա':'Bulgaria', 'Հայաստան':'Armenia', 'Բոսնիա և Հերցեգովինա':'Bosnia and Herzegovina', 'Դոնի շրջան':'Don', 'Էսպերանտո':'Esperanto', 'Էստոնիա':'Estonia', 'Էրզիա':'Erzia', 'Վրաստան':'Georgia', 'Չեխիա':'Czechia', 'Խորվաթիա':'Croatia', 'Կոսովո':'Kosovo', 'Ղրիմի թաթարներ':'Crimean Tatars', 'Լիտվա':'Lithuania', 'Լատվիա':'Latvia', 'Հունգարիա':'Hungary', 'Հյուսիսային Մակեդոնիա':'North Macedonia', 'Մակեդոնիա':'North Macedonia', 'Մակեդոնիայի Հանրապետություն':'North Macedonia', 'Մոլդովա':'Romania and Moldova', 'Չեռնոգորիա':'Montenegro', 'Լեհաստան':'Poland', 'Ռուսաստան':'Russia', 'Ռումինիա և Մոլդովա':'Romania and Moldova', 'Ռումինիա/Մոլդովա':'Romania and Moldova', 'Ռումինիա':'Romania and Moldova', 'Սերբիայի Հանրապետություն':'Serbia', 'Սերբիա':'Serbia', 'Սլովակիա':'Slovakia', 'Թաթարստան':'Tatarstan', 'Թուրքիա':'Turkey', 'Ուկրաինա':'Ukraine', 'Հունաստան':'Greece', 'Ղազախստան':'Kazakhstan', 'Սլովենիա':'Slovenia', 'Մալթա':'Malta', 'Լեհատան':'Poland', 'Հունաստամ':'Greece', 'Ալբանիաիա':'Albania', 'Սերբական Հանրապետություն':'Republic of Srpska', },
#ka countries
'ka':{ 'ალბანეთი':'Albania', 'ავსტრია':'Austria', 'აზერბაიჯანი':'Azerbaijan', 'ბაშკირეთი':'Bashkortostan', 'ბელარუსი':'Belarus', 'ბულგარეთი':'Bulgaria', 'სომხეთი':'Armenia', 'ბოსნია და ჰერცოგოვინა':'Bosnia and Herzegovina', 'ბოსნია და ჰერცეგოვინა':'Bosnia and Herzegovina', 'ესპერანტო':'Esperanto', 'ესტონეთი':'Estonia', 'ერზია':'Erzia', 'საქართველო':'Georgia', 'ჩეხეთი':'Czechia', 'ხორვატია':'Croatia', 'კოსოვო':'Kosovo', 'ყირიმელი თათრები':'Crimean Tatars', 'დონის რეგიონი':'Don', 'ლიტვა':'Lithuania', 'ლატვია':'Latvia', 'უნგრეთი':'Hungary', 'ჩრდილოეთი მაკედონია':'North Macedonia', 'ჩრდილოეთ მაკედონია':'North Macedonia', 'მაკედონია':'North Macedonia', 'მოლდოვა':'Romania and Moldova', 'რუმინეთი და მოლდოვა':'Romania and Moldova', 'პოლონეთი':'Poland', 'რუსეთის ფედერაცია':'Russia', 'რუსეთი':'Russia', 'რუმინეთი':'Romania and Moldova', 'სერბთა რესპუბლიკა':'Republic of Srpska', 'სერბეთი':'Serbia', 'სლოვაკეთი':'Slovakia', 'თურქეთი':'Turkey', 'უკრაინა':'Ukraine', 'საბერძნეთი':'Greece', 'ყაზახეთი':'Kazakhstan', },
#lv countries
'lv':{ 'Albānija':'Albania', 'Austrija':'Austria', 'Azerbaidžāna':'Azerbaijan', 'Baškortostāna':'Bashkortostan', 'Baškortostāna':'Bashkortostan', 'Baltkrievija':'Belarus', 'Bulgārija':'Bulgaria', 'Armēnija':'Armenia', 'Bosnija un Hercegovina':'Bosnia and Herzegovina', 'Donas reģions':'Don', 'erzji':'Erzia', 'Erzju':'Erzia', 'esperanto':'Esperanto', 'Esperanto':'Esperanto', 'Igaunija':'Estonia', 'Gruzija':'Georgia', 'Čehija':'Czechia', 'Horvātija':'Croatia', 'Kosova':'Kosovo', 'Krimas tatāri':'Crimean Tatars', 'Lietuva':'Lithuania', 'Latvija':'Latvia', 'Ungārija':'Hungary', 'Ziemeļmaķedonija':'North Macedonia', 'Maķedonija':'North Macedonia', 'Moldova':'Romania and Moldova', 'Melnkalne':'Montenegro', 'Polija':'Poland', 'Krievija':'Russia', 'Rumānija':'Romania and Moldova', 'Serbu Republika':'Republic of Srpska', 'Serbija':'Serbia', 'Slovākija':'Slovakia', 'Slovēnija':'Slovenia', 'Tatarstāna':'Tatarstan', 'Turcija':'Turkey', 'Ukraina':'Ukraine', 'Grieķija':'Greece', 'Kazahstāna':'Kazakhstan', 'Sorbi':'Sorbia', 'rumāņi':'Romania and Moldova', 'Malta':'Malta', 'sorbi':'Sorbia', },
#lt countries
'lt':{ 'Albanija':'Albania', 'Austrija':'Austria', 'Azerbaidžanas':'Azerbaijan', 'Baškirija':'Bashkortostan', 'Baltarusija':'Belarus', 'Bulgarija':'Bulgaria', 'Armėnija':'Armenia', 'Bosnija ir Hercegovina':'Bosnia and Herzegovina', 'Erzija':'Erzia', 'Erzių':'Erzia', 'Esperanto':'Esperanto', 'Estija':'Estonia', 'Gruzija':'Georgia', 'Čekija':'Czechia', 'Kroatija':'Croatia', 'Kosovas':'Kosovo', 'Krymas':'Crimean Tatars', 'Krymo totoriai':'Crimean Tatars', 'Lietuva':'Lithuania', 'Latvija':'Latvia', 'Vengrija':'Hungary', 'Šiaurės Makedonija':'North Macedonia', 'Makedonija':'North Macedonia', 'Moldavija':'Romania and Moldova', 'Lenkija':'Poland', 'Rusija':'Russia', 'Rumunija':'Romania and Moldova', 'Serbų Respublika':'Republic of Srpska', 'Serbų respublika':'Republic of Srpska', 'Serbija':'Serbia', 'Serbijos respublika':'Serbia', 'Slovakija':'Slovakia', 'Slovėnija':'Slovenia', 'Lužica':'Sorbia', 'Turkija':'Turkey', 'Ukraina':'Ukraine', 'Graikija':'Greece', 'Kazachstanas':'Kazakhstan', 'Tatarstanas':'Tatarstan' },
#mk countries
'mk':{ 'Албанија':'Albania', 'Австрија':'Austria', 'Азербејџан':'Azerbaijan', 'Башкортостан':'Bashkortostan', 'Bashkortostani':'Bashkortostan', 'Белорусија':'Belarus', 'Бугарија':'Bulgaria', 'Ерменија':'Armenia', 'Црна Гора':'Montenegro', 'Босна и Херцеговина':'Bosnia and Herzegovina', 'Донбас':'Don', 'Ерзја':'Erzia', 'есперанто':'Esperanto', 'Есперанто':'Esperanto', 'Естонија':'Estonia', 'Грузија':'Georgia', 'Чешка':'Czechia', 'Хрватска':'Croatia', 'Косово':'Kosovo', 'Република Косово':'Kosovo', 'Крим':'Crimean Tatars', 'Кримски Татари':'Crimean Tatars', 'Кримските Татари':'Crimean Tatars', 'Литванија':'Lithuania', 'Латвија':'Latvia', 'Унгарија':'Hungary', 'Македонија':'North Macedonia', 'Молдавија':'Romania and Moldova', 'Полска':'Poland', 'Русија':'Russia', 'Романија':'Romania and Moldova', 'Романија и Молдавија':'Romania and Moldova', 'Република Српска':'Republic of Srpska', 'Србија':'Serbia', 'Словачка':'Slovakia', 'Словенија':'Slovenia', 'Лужица':'Sorbia', 'Турција':'Turkey', 'Украина':'Ukraine', 'Грција':'Greece', 'Казахстан':'Kazakhstan', 'Татарстан':'Tatarstan', 'Хрватса':'Croatia', 'Донечка област':'Don', 'Малта':'Malta', 'Донскиот регион':'Don', },
#ro countries
'ro':{ 'Albania':'Albania', 'Austria':'Austria', 'Azerbaidjan':'Azerbaijan', 'Bașkortostan':'Bashkortostan', 'Bașchiria':'Bashkortostan', 'Belarus':'Belarus', 'Bulgaria':'Bulgaria', 'Armenia':'Armenia', 'Bosnia și Herțegovina':'Bosnia and Herzegovina', 'tătarii crimeeni':'Crimean tatars', 'Regiunea Donului':'Don', 'Don':'Don', 'Esperanto':'Esperanto', 'Estonia':'Estonia', 'Georgia':'Georgia', 'Cehia':'Czechia', 'Croația':'Croatia', 'Kosovo':'Kosovo', 'Crimeea':'Crimean Tatars', 'Lituania':'Lithuania', 'Letonia':'Latvia', 'Ungaria':'Hungary', 'Muntenegru':'Montenegro', 'Macedonia de Nord':'North Macedonia', 'Macedonia':'North Macedonia', 'Republica Moldova':'Romania and Moldova', 'Polonia':'Poland', 'Rusia':'Russia', 'România':'Romania and Moldova', 'Sorabi':'Sorbia', 'Republika Srpska':'Republic of Srpska', 'Serbia':'Serbia', 'Slovacia':'Slovakia', 'Slovenia':'Slovenia', 'Tatarstan':'Tatarstan', 'Turcia':'Turkey', 'Ucraina':'Ukraine', 'Grecia':'Greece', 'Kazahstan':'Kazakhstan', 'Erzia':'Erzia','Malta':'Malta', 'Tătarii din Crimeea':'Crimean tatars', 'sorabi':'Sorbia', 'Tătarii crimeeni':'Crimean Tatars', 'Republica Cehă':'Czechia', 'Mișcarea esperantistă':'Esperanto', },
#ru countries
'ru':{ 'Албания':'Albania', 'Австрия':'Austria', 'Азербайджан':'Azerbaijan', 'Башкортостан':'Bashkortostan', 'Беларусь':'Belarus', 'Белоруссия':'Belarus', 'Болгария':'Bulgaria', 'Армения':'Armenia', 'Босния и Герцеговина':'Bosnia and Herzegovina', 'Эрзя':'Erzia', 'Эсперантида':'Esperanto', 'Эсперанто':'Esperanto', 'Эстония':'Estonia', 'Грузия':'Georgia', 'Чехия':'Czechia', 'Хорватия':'Croatia', 'Косово':'Kosovo', 'Крымские татары':'Crimean Tatars', 'Литва':'Lithuania', 'Латвия':'Latvia', 'Венгрия':'Hungary', 'Республика Македония':'North Macedonia', 'Македония':'North Macedonia', 'Северная Македония':'North Macedonia', 'Молдавия':'Romania and Moldova', 'Черногория':'Montenegro', 'Польша':'Poland', 'Россия':'Russia', 'Румыния':'Romania and Moldova', 'Сербская Республика':'Republic of Srpska', 'Республика Сербская':'Republic of Srpska', 'Сербия':'Serbia', 'Лужичане':'Sorbia', 'Словакия':'Slovakia', 'Словения':'Slovenia', 'Татарстан':'Tatarstan', 'Турция':'Turkey', 'Украина':'Ukraine', 'Греция':'Greece', 'Казахстан':'Kazakhstan', 'Мальта':'Malta', },
#sq countries
'sq':{ 'Shqipëria':'Albania', 'Shqipërisë':'Albania', 'Shqipëria':'Albania', 'Armenia':'Armenia', 'Armenisë':'Armenia', 'Armeni':'Armenia', 'Austria':'Austria', 'Austri':'Austria', 'Azerbajxhani':'Azerbaijan', 'Azerbajxhanit':'Azerbaijan', 'Azerbajxhan':'Azerbaijan', 'Bashkortostani':'Bashkortostan', 'Bjellorusi':'Belarus', 'Bjellorusia':'Belarus', 'Bosnja dhe Hercegovina':'Bosnia and Herzegovina', 'Bullgaria':'Bulgaria', 'Kroaci':'Croatia', 'Kroacia':'Croatia', 'Kroacisë':'Croatia', 'Republika Çeke':'Czechia', 'Esperanto':'Esperanto', 'Gjuha esperanto':'Esperanto', 'Estoni':'Estonia', 'Estonia':'Estonia', 'Gjeorgjia':'Georgia', 'Gjeorgjisë':'Georgia', 'Greqi':'Greece', 'Greqia':'Greece', 'Greqisë':'Greece', 'Hungaria':'Hungary', 'Hungari':'Hungary', 'Kazakistan':'Kazakhstan', 'Kazakistani':'Kazakhstan', 'Kazakistanin':'Kazakhstan', 'Kosovë':'Kosovo', 'Kosova':'Kosovo', 'Kosovës':'Kosovo', 'Letoni':'Latvia', 'Letonia':'Latvia', 'Lituania':'Lithuania', 'Maltë':'Malta', 'Maqedonisë':'North Macedonia', 'Maqedoni e Veriut':'North Macedonia', 'Polonia':'Poland', 'Polonisë':'Poland', 'Poloni':'Poland', 'Moldavia':'Romania and Moldova', 'Moldavinë':'Romania and Moldova', 'Rumania':'Romania and Moldova', 'Moldavi':'Romania and Moldova', 'Rumani':'Romania and Moldova', 'Rusia':'Russia', 'Rusisë':'Russia', 'Rusi':'Russia', 'Serbia':'Serbia', 'Serbi':'Serbia', 'Sllovakia':'Slovakia', 'Sllovaki':'Slovakia', 'Slloveni':'Slovenia', 'Turqia':'Turkey', 'Turqisë':'Turkey', 'Turqi':'Turkey', 'Ukraina':'Ukraine', 'Ukrainë':'Ukraine', 'Erzya':'Erzia', 'Bullgari':'Bulgaria', 'Bosnje dhe Hercegovinë':'Bosnia and Herzegovina', 'Bashkortostan':'Bashkortostan', 'Tatarstan':'Tatarstan', 'Bosnjë dhe Hercegovinë':'Bosnia and Herzegovina', 'Shqipëri':'Albania', 'Çeki':'Czechia', 'gjuhën Esperanto':'Esperanto', },
#sr countries
'sr':{ 'Албанија':'Albania', 'Аустрија':'Austria', 'Атербејџан':'Azerbaijan', 'Азербејџан':'Azerbaijan', 'Башкортостан':'Bashkortostan', 'Белорусија':'Belarus', 'Бугарска':'Bulgaria', 'Јерменија':'Armenia', 'Босна':'Bosnia and Herzegovina', 'Босна и Херцеговина':'Bosnia and Herzegovina', 'Црна Гора':'Montenegro', 'Ерзја':'Erzia', 'Есперанто':'Esperanto', 'Естонија':'Estonia', 'Грузија':'Georgia', 'Чешка':'Czechia', 'Hrvatska':'Croatia', 'Хрватска':'Croatia', 'Република Косово':'Kosovo', 'Кримски Татари':'Crimean Tatars', 'Литванија':'Lithuania', 'Летонија':'Latvia', 'Мађарска':'Hungary', 'Северна Македонија':'North Macedonia', 'Македонија':'North Macedonia', 'Република Македонија':'North Macedonia', 'Молдавија':'Romania and Moldova', 'Пољска':'Poland', 'Руска Империја':'Russia', 'Rusija':'Russia', 'Русија':'Russia', 'Румунија':'Romania and Moldova', 'Република Српска':'Republic of Srpska', 'Србија':'Serbia', 'Словачка':'Slovakia', 'Словенија':'Slovenia', 'Турска':'Turkey', 'Украјина':'Ukraine', 'грчка':'Greece', 'Грчка':'Greece', 'Казахстан':'Kazakhstan', 'Grčka':'Greece', 'Малта':'Malta', },
#tt countries
'tt':{ 'Албания':'Albania', 'Австрия':'Austria', 'Әзербайҗан':'Azerbaijan', 'Азәрбайҗан':'Azerbaijan', 'Башкортстан':'Bashkortostan', 'Белорусия':'Belarus', 'Беларусия':'Belarus', 'Болгария':'Bulgaria', 'Әрмәнстан':'Armenia', 'Босния һәм Герцоговина':'Bosnia and Herzegovina', 'Босния һәм Герцеговина':'Bosnia and Herzegovina', 'Эрзя':'Erzia', 'Эрзә':'Erzia', 'Ирзә':'Erzia', 'Эсперанто':'Esperanto', 'Эстония':'Estonia', 'Гөрҗистан':'Georgia', 'Чехия':'Czechia', 'Хорватия':'Croatia', 'Косово Җөмһүрияте':'Kosovo', 'Кырым татарлары':'Crimean Tatars', 'Литва':'Lithuania', 'Latviä':'Latvia', 'Маҗарстан':'Hungary', 'Македония Җөмһүрияте':'North Macedonia', 'Македония':'North Macedonia', 'Молдавия':'Romania and Moldova', 'Молдова':'Romania and Moldova', 'Польша':'Poland', 'РФ':'Russia', 'Русия':'Russia', 'Румыния':'Romania and Moldova', 'Сербия':'Serbia', 'Словакия':'Slovakia', 'Лужица':'Sorbia', 'Төркия':'Turkey', 'Украина':'Ukraine', 'Греция':'Greece', 'Казакъстан':'Kazakhstan', 'Латвия':'Latvia', 'Aвстрия':'Austria', 'Грузия':'Georgia', 'Tөркия':'Turkey', 'Kосово':'Kosovo', 'Косово':'Kosovo', 'Төньяк Македония':'North Macedonia', 'Румыния һәм Moлдова':'Romania and Moldova', 'Словения':'Slovenia', 'Кырым-татар':'Crimean Tatars', },
#tr countries
'tr':{ 'Arnavutluk':'Albania', 'Avusturya':'Austria', 'Azerbaycan':'Azerbaijan', 'Başkurdistan':'Bashkortostan', 'Beyaz Rusya':'Belarus', 'Bulgaristan':'Bulgaria', 'Ermenistan':'Armenia', 'Bosna Hersek':'Bosnia and Herzegovina', 'Bosna-Hersek':'Bosnia and Herzegovina', 'Erzyanca':'Erzia', 'Erzya':'Erzia', 'Esperanto':'Esperanto', 'Estonya':'Estonia', 'Gürcistan':'Georgia', 'Çek Cumhuriyeti':'Czechia', 'Hırvatistan':'Croatia', 'Don Bölgesi':'Don', 'Kosova':'Kosovo', 'Kırım':'Crimean Tatars', 'Kırım Tatar':'Crimean Tatars', 'Kırım Tatarları':'Crimean Tatars', 'Litvanya':'Lithuania', 'Letonya':'Latvia', 'Macaristan':'Hungary', 'Malta':'Malta', 'Kuzey Makedonya':'North Macedonia', 'Makedonya Cumhuriyeti':'North Macedonia', 'Makedonya':'North Macedonia', 'Karadağ':'Montenegro', 'Moldova':'Romania and Moldova', 'Polonya':'Poland', 'Rusya':'Russia', 'СРСР':'Russia', 'Romanya':'Romania and Moldova', 'Sırp Cumhuriyeti':'Republic of Srpska', 'Sırbistan':'Serbia', 'Sorblar':'Sorbia', 'Slovakya':'Slovakia', 'Slovenya':'Slovenia', 'Türkiye':'Turkey', 'Ukrayna':'Ukraine', 'Yunanistan':'Greece', 'Kazakistan':'Kazakhstan', 'Tataristan':'Tatarstan', 'Sırbistan Cumhuriyeti':'Republic of Srpska', 'Sıbistan':'Serbia', },
#uk countries
'uk':{ 'Албанія':'Albania', 'Австрія':'Austria', 'Азербайджан':'Azerbaijan', 'Башкортостан':'Bashkortostan', 'Білорусія':'Belarus', 'Білорусь':'Belarus', 'Болгарія':'Bulgaria', 'Вірменія':'Armenia', 'Боснія':'Bosnia and Herzegovina', 'Боснія і Герцеговина':'Bosnia and Herzegovina', 'Боснія і Герцеговина':'Bosnia and Herzegovina', 'Боснія і Герцоговина':'Bosnia and Herzegovina', 'Боснія та Герцеговина':'Bosnia and Herzegovina', 'Дон':'Don', 'Ерзя':'Erzia', 'Есперантида':'Esperanto', 'Есперанто':'Esperanto', 'есперанто':'Esperanto', 'Естонія':'Estonia', 'Грузія':'Georgia', 'Чехія':'Czechia', 'Хорватія':'Croatia', 'Косово':'Kosovo', 'Кримські Татари':'Crimean Tatars', 'Кримські татари':'Crimean Tatars', 'Литва':'Lithuania', 'Латвія':'Latvia', 'Угорщина':'Hungary', 'Македонія':'North Macedonia', 'Північна Македонія':'North Macedonia', 'Румунія, Молдова':'Romania and Moldova', 'Молдова':'Romania and Moldova', 'Чорногорія':'Montenegro', 'Польша':'Poland', 'Польща':'Poland', 'Російська Федерація':'Russia', 'СРСР':'Russia', 'Росія':'Russia', 'Румунія':'Romania and Moldova', 'Румунія і Молдова':'Romania and Moldova', 'Республіка Сербська':'Republic of Srpska', 'Сербія':'Serbia', 'Словакія':'Slovakia', 'Словаччина':'Slovakia', 'Словенія':'Slovenia', 'Лужичани':'Sorbia', 'лужичани':'Sorbia', 'Татарстан':'Tatarstan', 'Туреччина':'Turkey', 'Туречинна':'Turkey', 'Україна':'Ukraine', 'Греція':'Greece', 'Казахстан':'Kazakhstan', 'Мальта':'Malta', },
#hu countries
'hu':{ 'Albánia':'Albania', 'Ausztria':'Austria', 'Azerbajdzsán':'Azerbaijan', 'Baskíria':'Bashkortostan', 'Baskirföld':'Bashkortostan', 'Fehéroroszország':'Belarus', 'Belorusz':'Belarus', 'Bulgária':'Bulgaria', 'Örményország':'Armenia', 'Bosznia-Hercegovina':'Bosnia and Herzegovina', 'Bosznia és Hercegovina':'Bosnia and Herzegovina', 'Doni régió':'Don', 'Erzia':'Erzia', 'Eszperantó':'Esperanto', 'Észtország':'Estonia', 'Grúzia':'Georgia', 'Csehország':'Czechia', 'Horvátország':'Croatia', 'Koszovó':'Kosovo', 'Koszovo':'Kosovo', 'Krími tatárok':'Crimean Tatars', 'Litvánia':'Lithuania', 'Lettország':'Latvia', 'Magyarország':'Hungary', 'Montenegró':'Montenegro', 'Macedónia':'North Macedonia', 'Észak-Macedónia':'North Macedonia', 'Moldávia':'Romania and Moldova', 'Lengyelország':'Poland', 'Moldova':'Romania and Moldova', 'Oroszország':'Russia', 'Románia':'Romania and Moldova', 'Boszniai Szerb Köztársaság':'Republic of Srpska', 'Szerbia':'Serbia', 'Szlovákia':'Slovakia', 'Szlovénia':'Slovenia', 'Tatárföld':'Tatarstan', 'Törökország':'Turkey', 'Ukrajna':'Ukraine', 'Görögország':'Greece', 'Kazahsztán':'Kazakhstan', 'Málta':'Malta', 'Szorbok':'Sorbia', },
#kk countries
'kk':{ 'Албания':'Albania', 'Аустрия':'Austria', 'Әзірбайжан':'Azerbaijan', 'Башқұртстан':'Bashkortostan', 'Беларусь':'Belarus', 'Болгария':'Bulgaria', 'Армения':'Armenia', 'Босния және Герцеговина':'Bosnia and Herzegovina', 'Эсперанто':'Esperanto', 'Эстония':'Estonia', 'Грузия':'Georgia', 'Чехия':'Czechia', 'Хорватия':'Croatia', 'Косово':'Kosovo', 'Қырым татарлары':'Crimean Tatars', 'Литва':'Lithuania', 'Латвия':'Latvia', 'Мажарстан':'Hungary', 'Македония':'North Macedonia', 'Молдова':'Romania and Moldova', 'Польша':'Poland', 'Ресей':'Russia', 'Румыния':'Romania and Moldova', 'Сербия':'Serbia', 'Словакия':'Slovakia', 'Түркия':'Turkey', 'Украина':'Ukraine', 'Грекия':'Greece', 'Қазақстан':'Kazakhstan', 'Татарстан':'Tatarstan', },
#et countries
'et':{ 'Albaania':'Albania', 'Austria':'Austria', 'Aserbaidžaan':'Azerbaijan', 'Baškortostanu':'Bashkortostan', 'Baškortostan':'Bashkortostan', 'Valgevene':'Belarus', 'Bulgaaria':'Bulgaria', 'Armeenia':'Armenia', 'Bosnia ja Hertsegoviina':'Bosnia and Herzegovina', 'Doni piirkond':'Don', 'Esperanto':'Esperanto', 'Eesti':'Estonia', 'Gruusia':'Georgia', 'Tšehhi Vabariik':'Czechia', 'Tšehhi':'Czechia', 'Horvaatia':'Croatia', 'Kosovo':'Kosovo', 'Krimski Tatari':'Crimean Tatars', 'Leedu':'Lithuania', 'Läti':'Latvia', 'Ungari':'Hungary', 'Montenegro':'Montenegro', 'Põhja-Makedoonia':'North Macedonia', 'Makedoonia':'North Macedonia', 'Moldova':'Romania and Moldova', 'Poola':'Poland', 'Venemaa':'Russia', 'Rumeenia':'Romania and Moldova', 'Serblaste Vabariik':'Republic of Srpska', 'Republika Srpska':'Republic of Srpska', 'Serbia':'Serbia', 'Sorbimaa':'Sorbia', 'Slovakkia':'Slovakia', 'Sloveenia':'Slovenia', 'Tatarstan':'Tatarstan', 'Türgi':'Turkey', 'Ukraina':'Ukraine', 'Kreeka':'Greece', 'Kasahstan':'Kazakhstan', 'Ersa':'Erzia', 'Malta':'Malta', 'Krimmitatari':'Crimean Tatars', 'esperanto':'Esperanto', 'Sorbi':'Sorbia', 'Doni regioon':'Don', },
#hr countries
'hr':{ 'Albaniji':'Albania', 'Albanija':'Albania', 'Austriji':'Austria', 'Austrija':'Austria', 'Azerbajdžanu':'Azerbaijan', 'Azerbajdžan':'Azerbaijan', 'Baškortostanu (Bashkortostan)':'Bashkortostan', 'Baškirska':'Bashkortostan', 'Bjelorusiji':'Belarus', 'Bjelorusija':'Belarus', 'Bugarskoj':'Bulgaria', 'Bugarska':'Bulgaria', 'Armeniji':'Armenia', 'Armenija':'Armenia', 'Bosni i Hercegovini':'Bosnia and Herzegovina', 'Bosne i Hercegovine':'Bosnia and Herzegovina', 'Bosna i Hercegovina':'Bosnia and Herzegovina', 'Crnoj Gori':'Montenegro', 'esperantu':'Esperanto', 'Esperanto':'Esperanto', 'Estoniji':'Estonia', 'Estonija':'Estonia', 'Gruziji':'Georgia', 'Gruziji (Georgia)':'Georgia', 'Gruzija':'Georgia', 'Mađarske':'Hungary', 'Češkoj (Czech)':'Czechia', 'Češkoj':'Czechia', 'Češka':'Czechia', 'Hrvatskoj':'Croatia', 'Hrvatska':'Croatia', 'Kosovo':'Kosovo', 'Kosovu':'Kosovo', 'Krimskih Tatara':'Crimean Tatars', 'Krim (Krimski Tatari)':'Crimean Tatars', 'Krimu (Krimski Tatari)':'Crimean Tatars', 'Krimski Tatari':'Crimean Tatars', 'Litvi':'Lithuania', 'Litva':'Lithuania', 'Latviji':'Latvia', 'Latvija':'Latvia', 'Mađarskoj':'Hungary', 'Mađarska':'Hungary', 'Makedoniji':'North Macedonia', 'Makedonija':'North Macedonia', 'Moldaviji':'Romania and Moldova', 'Moldavija':'Romania and Moldova', 'Poljskoj':'Poland', 'Poljska':'Poland', 'Rusiji':'Russia', 'Rusija':'Russia', 'Rumunjskoj (Romania)':'Romania and Moldova', 'Rumunjskoj':'Romania and Moldova', 'Rumunjska':'Romania and Moldova', 'Republici Srpskoj':'Republic of Srpska', 'Republika Srpska':'Republic of Srpska', 'Srbiji':'Serbia', 'Srbije':'Serbia', 'Srbija':'Serbia', 'Slovačkoj':'Slovakia', 'Slovačkoj (Slovakia)':'Slovakia', 'Slovačka':'Slovakia', 'Sloveniji':'Slovenia', 'Turskoj':'Turkey', 'Turska':'Turkey', 'Ukrajini':'Ukraine', 'Ukrajina':'Ukraine', 'Grčkoj':'Greece', 'Grčka':'Greece', 'Kazahstanu':'Kazakhstan', 'Kazahstan':'Kazakhstan', 'Erziji (Erzya)':'Erzia', 'Erziji':'Erzia', 'Erzya':'Erzia', 'Erzji':'Erzia', 'BiH':'Bosnia and Herzegovina', 'Malti':'Malta', 'Bugarske':'Bulgaria', 'Lužički Srbi':'Sorbia', 'Sjevernoj Makedoniji':'North Macedonia', 'Slovenija':'Slovenia', 'Donu':'Don', 'Kazahstana':'Kazakhstan', 'Tatarstana':'Tatarstan', 'Rusije':'Russia', 'Tatarstanu':'Tatarstan', 'Baškirskoj':'Bashkortostan', 'Esperantu':'Esperanto', },
#sl countries
'sl':{ 'Albanija':'Albania', 'Armenija':'Armenia', 'Avstrija':'Austria', 'Azerbajdžan':'Azerbaijan', 'Baškortostan':'Bashkortostan', 'Belorusija':'Belarus', 'Bolgarija':'Bulgaria', 'Bosna in Hercegovina':'Bosnia and Herzegovina', 'Češka':'Czechia', 'Črna gora':'Montenegro', 'Donska republika':'Don', 'Erzja':'Erzia', 'Esperanto':'Esperanto', 'Estonija':'Estonia', 'Grčija':'Greece', 'Gruzija':'Georgia', 'Hrvaška':'Croatia', 'Kazahstan':'Kazakhstan', 'Kosovo':'Kosovo', 'Krimski Tatar':'Crimean Tatars', 'Latvija':'Latvia', 'Litva':'Lithuania', 'Lužiška Srbija':'Sorbia', 'Madžarska':'Hungary', 'Malta':'Malta', 'Poljska':'Poland', 'Romunija':'Romania and Moldova', 'Rusija':'Russia', 'Severna Makedonija':'North Macedonia', 'Slovaška':'Slovakia', 'Srbija':'Serbia', 'Tatarstan':'Tatarstan', 'Turčija':'Turkey', 'Ukrajina':'Ukraine', 'Donska regija':'Don', 'Romunija in Moldavija':'Romania and Moldova', 'Republika srbska':'Republic of Srpska', 'Moldavija':'Romania and Moldova', },
#mt countries
'mt':{ 'Awstrija':'Austria', 'Slovakja':'Slovakia', 'Ċekja':'Czechia', 'Bożnija u Ħerżegovina':'Bosnia and Herzegovina', 'Greċja':'Greece', 'Polonja':'Poland', 'Albania':'Albania', 'Tararstan':'Tatarstan', 'Armenia':'Armenia', 'Azerbajġan':'Azerbaijan', 'Baxkortostan':'Bashkortostan', 'Malta':'Malta', 'Belarus':'Belarus', 'Bożnija-Ħerzegovina':'Bosnia and Herzegovina', 'Sorbi':'Sorbia','Bulgarija':'Bulgaria', 'Tatar tal-Krimea':'Crimean Tatars', 'Maċedonja ta':'North Macedonia', 'Kosovo':'Kosovo', 'Albanija':'Albania', 'Turkija':'Turkey', 'Serbja':'Serbia', 'Montenegro':'Montenegro', 'BUlgarija':'Bulgaria', 'Ungerija':'Hungary', 'Estonja':'Estonia', 'Latvja':'Latvia', 'Litwanja':'Lithuania', 'Rumanija':'Romania and Moldova', 'Slovakkja':'Slovakia', 'Slovenja':'Slovenia', 'Kroazja':'Croatia', 'Don region':'Don','Erzya':'Erzia', 'Esperanto':'Esperanto', 'Estonja':'Estonia', 'Turkija':'Turkey', 'Ġeorġja':'Georgia', 'Każakistan':'Kazakhstan', 'Macedonja tat-Tramuntana':'North Macedonia', 'Ir-Repubblika ta’ Srpska':'Republic of Srpska', 'Rumanija u Moldova':'Romania and Moldova', 'Sorb':'Sorbia', 'Tatarstan':'Tatarstan', 'Ukrajna':'Ukraine', 'Federazzjoni Russa':'Russia', 'Armenja':'Armenia', 'Ażerbajġan':'Azerbaijan', 'Reġjun Don':'Don', 'Erżja':'Erzia', 'Repubblika Srpska':'Republic of Srpska', },
#sk countries
'sk':{ 'Slovinsko':'Slovenia', 'Maďarsko':'Hungary', 'Rakúsko':'Austria', 'Rumunsko':'Romania and Moldova', 'Bosna a Hercegovina':'Bosnia and Herzegovina', 'Gruzínsko':'Georgia', 'Chorvátsko':'Croatia', 'Kazachstan':'Kazakhstan', 'Česko':'Czechia', 'Estónsko':'Estonia', 'Grécko':'Greece', 'Severné Macedónsko':'North Macedonia', 'Lotyšsko':'Latvia', 'Rusko':'Russia', 'Uhorsko':'Hungary', 'Moldavsko':'Romania and Moldova', 'Malta':'Malta', 'Esperanto':'Esperanto', 'Srbsko':'Serbia', 'Litva':'Lithuania', 'Ukrajina':'Ukraine', 'Bulharsko':'Bulgaria', 'Albánsko':'Albania', 'Poľsko':'Poland', 'Lužickí Srbi':'Sorbia', 'Kosovo':'Kosovo', 'Azerbajdžan':'Azerbaijan', 'Turecko':'Turkey', 'Baškirsko':'Bashkortostan', 'Arménsko':'Armenia', 'Bielorusko':'Belarus', 'Republika Srpska':'Republic of Srpska', 'Donský región':'Don', 'Krymskí Tatári':'Crimean Tatars', 'Čierna Hora':'Montenegro', 'Montenegro':'Montenegro', 'Erzia':'Erzia', 'Erzya':'Erzia', 'Tatarstan':'Tatarstan', 'Tatársko':'Tatarstan', 'Sorbia':'Sorbia', },
}
class BasicBot(
# Refer pywikobot.bot for generic bot classes
#SingleSiteBot, # A bot only working on one site
MultipleSitesBot, # A bot only working on one site
# CurrentPageBot, # Sets 'current_page'. Process it in treat_page method.
# # Not needed here because we have subclasses
ExistingPageBot, # CurrentPageBot which only treats existing pages
NoRedirectPageBot, # CurrentPageBot which only treats non-redirects
AutomaticTWSummaryBot, # Automatically defines summary; needs summary_key
):
"""
An incomplete sample bot.
@ivar summary_key: Edit summary message key. The message that should be used
is placed on /i18n subdirectory. The file containing these messages
should have the same name as the caller script (i.e. basic.py in this
case). Use summary_key to set a default edit summary message.
@type summary_key: str
"""
summary_key = 'basic-changing'
springList = {}
templatesList = {}
authors = {}
authorsData = {}
authorsArticles = {}
missingCount = {}
pagesCount = {}
countryTable = {}
lengthTable = {}
womenAuthors = {} # authors of articles about women k:author v; (count,[list])
otherCountriesList = {'pl':[], 'az':[], 'ba':[], 'be':[], 'be-tarask':[], 'bg':[], 'de':[], 'crh':[], 'el':[], 'et':[], 'myv':[], 'eo':[], 'hr':[], 'hy':[], 'ka':[], 'kk':[], 'lv':[], 'lt':[], \
'mk':[], 'mt':[], 'ro':[], 'ru':[], 'sk':[], 'sl':[], 'sq':[], 'sr':[], 'tt':[], 'tr':[], 'uk':[], 'hu':[]}
women = {'pl':0, 'az':0, 'ba':0, 'be':0, 'be-tarask':0, 'bg':0, 'de':0, 'crh':0, 'el':0, 'et':0, 'myv':0, 'eo':0, 'hr':0, 'hy':0, 'ka':0, 'kk':0, 'lv':0, 'lt':0, \
'mk':0, 'mt':0, 'ro':0, 'ru':0, 'sk':0, 'sl':0, 'sq':0, 'sr':0, 'tt':0, 'tr':0, 'uk':0, 'hu':0}
countryp = { 'pl':'kraj', 'az':'ölkə', 'ba':'ил', 'be':'краіна', 'be-tarask':'краіна', 'bg':'държава', 'de':'land', 'crh':'memleket', 'eo':'lando', 'el':'country', 'et':'maa', \
'myv':'мастор', 'hu':'ország', 'ka':'ქვეყანა', 'lv':'valsts', 'lt':'šalis', 'mk':'земја', 'mt':'pajjiż', 'myv':'мастор', 'ro':'țară', 'ru':'страна',\
'sl':'država', 'sk':'Krajina', 'sq':'country', 'sr':'држава', 'tt':'ил', 'tr':'ülke', 'uk':'країна', 'hr':'zemlja', 'hy':'երկիր', 'kk':'ел', }
topicp = {'pl':'parametr', 'az':'qadınlar', 'ba':'тема', 'be':'тэма', 'be-tarask':'тэма', 'bg':'тема', 'de':'thema', 'crh':'mevzu', 'el':'topic', 'et':'teema', \
'eo':'temo', 'hu':'téma', 'ka':'თემა', 'lv':'tēma', 'lt':'tema', 'mk':'тема', 'myv':'тема', 'ro':'secțiune', 'ru':'тема', 'sl':'tema', 'sk':'Parameter', 'sq':'topic', 'sr':'тема', \
'tt':'тема', 'tr':'konu', 'uk':'тема', 'hr':'tema', 'hy':'Թուրքիա|թեմա', 'kk':'тақырып', }
womenp = {'pl':'kobiety', 'az':'qadınlar', 'ba':'Ҡатын-ҡыҙҙар', 'be':'Жанчыны', 'be-tarask':'жанчыны', 'bg':'жени', 'de':'Frauen','el':'γυναίκες', 'et':'naised', \
'ka':'ქალები', 'lv':'Sievietes','mk':'Жени', 'ro':'Femei', 'ru':'женщины', 'sl':'Ženske', 'sk':'Žena', 'sq':'Gratë', 'sr':'Жене', 'tt':'Хатын-кызлар', 'tr':'Kadın',\
'uk':'жінки', 'hu':'nők', 'hr':'Žene', 'hy':'Կանայք'}
userp = {'pl':'autor', 'az':'istifadəçi', 'ba':'ҡатнашыусы', 'be':'удзельнік', 'be-tarask':'удзельнік', 'bg':'потребител',\
'de':'benutzer','crh':'qullanıcı','el':'user', 'et':'kasutaja', 'hu':'szerkesztő', 'myv':'сёрмадыця', 'eo':'uzanto', 'ka':'მომხმარებელი', 'lv':'dalībnieks', 'lt':'naudotojas',\
'mk':'корисник', 'mt':'utent', 'myv':'сёрмадыця', 'ro':'utilizator', 'ru':'участник', 'sl':'uporabnik', 'sk':'Redaktor', 'sq':'user', 'sr':'корисник', 'tt':'кулланучы', 'tr':'kullanıcı', \
'uk':'користувач', 'hr':'suradnik', 'hy':'մասնակից', 'kk':'қатысушы', }
def __init__(self, generator, **kwargs):
"""
Constructor.
@param generator: the page generator that determines on which pages
to work
@type generator: generator
"""
# Add your own options to the bot and set their defaults
# -always option is predefined by BaseBot class
self.availableOptions.update({
'replace': False, # delete old text and write the new text
'summary': None, # your own bot summary
'text': 'Test', # add this text from option. 'Test' is default
'top': False, # append text on top of the page
'outpage': u'User:mastiBot/test', #default output page
'maxlines': 1000, #default number of entries per page
'testprint': False, # print testoutput
'negative': False, #if True negate behavior i.e. mark pages that DO NOT contain search string
'test': False, # make verbose output
'test2': False, # make verbose output
'test3': False, # make verbose output
'test4': False, # make verbose output
'test5': False, # make verbose output
'testartinfo': False, # make verbose output
'testgetart': False, # make verbose output
'testwomen': False, # make verbose output for women table
'testwomenauthors': False, # make verbose output for women authors table
'testnewbie': False, # make verbose output for newbies
'testlength': False, # make verbose output for article length
'testpickle': False, # make verbose output for article list load/save
'testusername': False, # make verbose output for username found in template
'testauthorwiki': False, # make verbose output for author/wiki
'testinterwiki': False, # make verbose output for interwiki
'testtemplatearg': False, # make verbose output for interwiki
'short': False, # make short run
'append': False,
'reset': False, # rebuild database from scratch
'progress': False, #report progress
})
# call constructor of the super class
#super(BasicBot, self).__init__(site=True, **kwargs)
super(BasicBot, self).__init__(**kwargs)
# assign the generator to the bot
self.generator = generator
def articleExists(self,art):
#check if article already in springList
result = False
lang = art.site.code
title = art.title()
if self.getOption('testpickle'):
pywikibot.output('testing existence: [%s:%s]' % (lang,title))
if lang in self.springList.keys():
for a in self.springList[lang]:
if self.getOption('testpickle'):
pywikibot.output('checking existence: [%s:%s]==%s' % (lang,title,a['title']))
if a['title'] == title:
result = True
return(result)
return(result)
def run(self):
#load springList from previous run
self.springList = self.loadArticleList()
#generate dictionary of articles
# article[pl:title] = pageobject
ceeArticles = self.getArticleList()
#self.printArtList(ceeArticles)
pywikibot.output(u'ART INFO')
count = 0
for a in ceeArticles:
count += 1
if self.articleExists(a):
if self.getOption('testpickle'):
pywikibot.output('[%s][%i] SKIPPING: [%s:%s]' % (datetime.now().strftime("%Y-%m-%d %H:%M:%S"),count, a.site.code,a.title()))
else:
aInfo = self.getArtInfo(a)
if self.getOption('test'):
pywikibot.output(aInfo)
if self.getOption('progress') and not count % 50:
pywikibot.output('[%s][%i] Lang:%s Article:%s' % \
(datetime.now().strftime("%Y-%m-%d %H:%M:%S"),count,aInfo['lang'],aInfo['title']))
#populate article list per language
if aInfo['lang'] not in self.springList.keys():
self.springList[aInfo['lang']] = []
self.springList[aInfo['lang']].append(aInfo)
#populate authors list
"""
if aInfo['newarticle']:
user = aInfo['creator']
if self.getOption('testnewbie'):
pywikibot.output('NEWBIE CREATOR:%s' % user)
if aInfo['creator'] not in self.authors.keys():
self.authors[aInfo['creator']] = 1
else:
self.authors[aInfo['creator']] += 1
else:
user = aInfo['template']['user']
if self.getOption('testnewbie'):
pywikibot.output('NEWBIE FROM TEMPLATE:%s' % user)
if aInfo['template']['user'] not in self.authors.keys():
self.authors[aInfo['template']['user']] = 1
else:
self.authors[aInfo['template']['user']] += 1
"""
user = aInfo['creator']
if self.getOption('testnewbie'):
pywikibot.output('NEWBIE CREATOR:%s' % user)
if aInfo['creator'] not in self.authors.keys():
self.authors[aInfo['creator']] = 1
else:
self.authors[aInfo['creator']] += 1
self.newbie(aInfo['lang'],user)
self.printArtInfo(self.springList)
#print self.springList
# save list for the future
self.saveArticleList(self.springList)
self.createCountryTable(self.springList) #generate results for pages about countries
self.createWomenTable(self.springList) #generate results for pages about women
self.createWomenAuthorsTable(self.springList) #generate results for pages about women
self.createLengthTable(self.springList) #generate results for pages length
self.createAuthorsArticles(self.springList) #generate list of articles per author/wiki
header = u'{{TNT|Wikimedia CEE Spring 2020 navbar}}\n\n'
header += u'{{Wikimedia CEE Spring 2020/Statistics/Header}}\n\n'
#header += u"Last update: '''<onlyinclude>{{#time: Y-m-d H:i|{{REVISIONTIMESTAMP}}}} UTC</onlyinclude>'''.\n\n"
header += u"Last update: '''%s CEST'''.\n\n" % datetime.now().strftime("%Y-%m-%d %H:%M:%S")
footer = u''
self.generateOtherCountriesTable(self.otherCountriesList,self.getOption('outpage')+u'/Other countries',header,footer)
self.generateResultCountryTable(self.countryTable,self.getOption('outpage'),header,footer)
self.generateResultArticleList(self.springList,self.getOption('outpage')+u'/Article list',header,footer)
self.generateResultAuthorsPage(self.authors,self.getOption('outpage')+u'/Authors list',header,footer)
self.generateAuthorsCountryTable(self.authorsArticles,self.getOption('outpage')+u'/Authors list/per wiki',header,footer)
self.generateResultWomenPage(self.women,self.getOption('outpage')+u'/Articles about women',header,footer)
self.generateResultWomenAuthorsTable(self.womenAuthors,self.getOption('outpage')+u'/Articles about women/Authors',header,footer) #generate results for pages about women
self.generateResultLengthPage(self.lengthTable,self.getOption('outpage')+u'/Article length',header,footer)
self.generateResultLengthAuthorsPage(self.lengthTable,self.getOption('outpage')+u'/Authors list over 2kB',header,footer)
return
def newbie(self,lang,user):
#check if user is a newbie
if not user:
return(False)
newbieLimit = datetime.strptime("2019-12-20T12:00:00Z", "%Y-%m-%dT%H:%M:%SZ")
if self.getOption('testnewbie'):
pywikibot.output('NEWBIE:%s' % self.authorsData)
if user in self.authorsData.keys():
if lang not in self.authorsData[user]['wikis']:
self.authorsData[user]['wikis'].append(lang)
if self.authorsData[user]['anon']:
return(False)
if not self.authorsData[user]['newbie']:
return(False)
else:
self.authorsData[user] = {'newbie':True, 'wikis':[lang], 'anon':False, 'gender':'unknown'}
userpage = u'user:' + user
site = pywikibot.Site(lang,fam='wikipedia')
#page = pywikibot.Page(site,userpage)
if self.getOption('testnewbie'):
pywikibot.output('GETTING USER DATA:[[:%s:%s]]' % (lang,userpage))
try:
userdata = pywikibot.User(site,userpage)
except:
pywikibot.output('NEWBIE Exception: [[%s:user:%s]]' % (lang,user))
return(False)
self.authorsData[user]['anon'] = userdata.isAnonymous()
if self.authorsData[user]['anon']:
return(False)
usergender = userdata.gender()
if not self.authorsData[user]['gender'] == 'female':
self.authorsData[user]['gender'] = usergender
if self.authorsData[user]['newbie']:
reg = userdata.registration()
if reg:
register = datetime.strptime(str(reg), "%Y-%m-%dT%H:%M:%SZ")
if register < newbieLimit:
self.authorsData[user]['newbie'] = False
else:
self.authorsData[user]['newbie'] = False
if self.getOption('testnewbie'):
pywikibot.output('NEWBIE [%s]:%s' % (user,self.authorsData[user]))
pywikibot.output('registration:%s' % reg)
return(self.authorsData[user]['newbie'])
def createCountryTable(self,aList):
#creat dictionary with la:country article counts
if self.getOption('test2'):
pywikibot.output(u'createCountryTable')
artCount = 0
countryCount = 0
for l in aList.keys():
for a in aList[l]:
#print a
artCount += 1
lang = a['lang'] #source language
tmpl = a['template'] #template data {country:[clist], women:T/F, nocountry:T/F}
if self.getOption('test2'):
pywikibot.output('tmpl:%s' % tmpl)
if u'country' in tmpl.keys():
cList = tmpl['country']
else:
continue
if lang not in self.countryTable.keys():
self.countryTable[lang] = {}
if tmpl['nocountry']:
if 'Empty' in self.countryTable[lang].keys():
self.countryTable[lang]['Empty'] += 1
else:
self.countryTable[lang]['Empty'] = 1
else:
for c in cList:
if c not in self.countryTable[lang].keys():
self.countryTable[lang][c] = 0
self.countryTable[lang][c] += 1
countryCount += 1
if self.getOption('test2'):
pywikibot.output(u'art:%i coutry:%i, [[%s:%s]]' % (artCount, countryCount, lang, a['title']))
return
def createWomenTable(self,aList):
#creat dictionary with la:country article counts
if self.getOption('test') or self.getOption('testwomen'):
pywikibot.output(u'createWomenTable')
pywikibot.output(self.women)
artCount = 0
countryCount = 0
for l in aList.keys():
for a in aList[l]:
#print a
artCount += 1
lang = a['lang'] #source language
tmpl = a['template'] #template data {country:[clist], women:T/F}
if u'woman' in tmpl.keys():
if not tmpl['woman']:
continue
else:
continue
if self.getOption('testwomen'):
pywikibot.output('tmpl:%s' % tmpl)
if lang not in self.women.keys():
self.women[lang] = 1
else:
self.women[lang] += 1
if self.getOption('testwomen'):
pywikibot.output('self.women[%s]:%i' % (lang,self.women[lang]))
countryCount += 1
if self.getOption('test') or self.getOption('testwomen'):
pywikibot.output(u'art:%i Women:True [[%s:%s]]' % (artCount, lang, a['title']))
if self.getOption('testwomen'):
pywikibot.output('**********')
pywikibot.output('self.women')
pywikibot.output('**********')
pywikibot.output(self.women)
return
def createWomenAuthorsTable(self,aList):
#creat dictionary with la:country article counts
if self.getOption('test') or self.getOption('testwomenauthors'):
pywikibot.output(u'createWomenAuthorsTable')
pywikibot.output(self.womenAuthors)
artCount = 0
countryCount = 0
for l in aList.keys():
for a in aList[l]:
#print a
artCount += 1
if self.getOption('testwomenauthors'):
pywikibot.output('article:%s' % a)
lang = a['lang'] #source language
tmpl = a['template'] #template data {country:[clist], women:T/F}
newart = a['newarticle']
womanart = tmpl['woman']
if not newart:
if self.getOption('test') or self.getOption('testwomenauthors'):
pywikibot.output(u'Skipping updated [%i]: [[%s:%s]]' % (artCount,lang,a['title']))
continue
if not womanart:
if self.getOption('test') or self.getOption('testwomenauthors'):
pywikibot.output(u'Skipping NOT WOMAN [%i]: [[%s:%s]]' % (artCount,lang,a['title']))
continue
user = a['creator']
if user in self.womenAuthors.keys():
self.womenAuthors[user]['count'] += 1
self.womenAuthors[user]['list'].append(lang+':'+a['title'])
else:
self.womenAuthors[user] = {'count':1, 'list':[lang+':'+a['title']]}
if self.getOption('testwomenauthors'):
pywikibot.output('**********')
pywikibot.output('self.women.authors')
pywikibot.output('**********')
pywikibot.output(self.womenAuthors)
return
def createLengthTable(self,aList):
#creat dictionary with la:country article counts
if self.getOption('test') or self.getOption('testwomen') or self.getOption('testlength'):
pywikibot.output(u'createLengthTable')
pywikibot.output(self.lengthTable)
artCount = 0
countryCount = 0
for l in aList.keys():
for a in aList[l]:
if a['newarticle']:
artCount += 1
lang = a['lang'] #source language
title = lang + ':' + a['title'] #art title
if self.getOption('testlength'):
pywikibot.output('Title:%s' % title)
self.lengthTable[title] = { 'char':a['charcount'], 'word':a['wordcount'], 'creator':a['creator'] }
if self.getOption('testlength'):
pywikibot.output('self.lengthtable[%s]:%s' % (title,self.lengthTable[title]))
if self.getOption('testlength'):
pywikibot.output('**********')
pywikibot.output('self.lengthTable')
pywikibot.output('**********')
pywikibot.output(self.lengthTable)
return
def createAuthorsArticles(self,aList):
#creat dictionary with author:wiki:{count,[artlist]} in self.authorsArticles
if self.getOption('test') or self.getOption('testauthorwiki'):
pywikibot.output(u'createAuthorsArticles')
wikilist = list(aList.keys())
artCount = 0
countryCount = 0
for l in aList.keys():
for a in aList[l]:
author = a['creator']
if author not in self.authorsArticles.keys():
self.authorsArticles[author] = {}
for lang in wikilist:
self.authorsArticles[author][lang] = {'count':0, 'list':[]}
self.authorsArticles[author][l]['count'] += 1
self.authorsArticles[author][l]['list'].append(a['title'])
if self.getOption('testauthorwiki'):
pywikibot.output('**********')
pywikibot.output('createAuthorsArticles')
pywikibot.output('**********')
pywikibot.output(self.authorsArticles)
return
def loadArticleList(self):
#load article list form pickled dictionary
result = {}
if self.getOption('reset'):
if self.getOption('testpickle'):
pywikibot.output('PICKLING SKIPPED at %s' % datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
else:
if self.getOption('testpickle'):
pywikibot.output('PICKLING LOAD at %s' % datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
try:
with open('masti/CEESpring2020.dat', 'rb') as datfile:
result = pickle.load(datfile)
except (IOError, EOFError):
# no saved history exists yet, or history dump broken
if self.getOption('testpickle'):
pywikibot.output('PICKLING FILE NOT FOUND')
result = {}
if self.getOption('testpickle'):
pywikibot.output('PICKLING LOADED LANGUAGES: %i' % len(result))
pywikibot.output('PICKLING RESULT:%s' % result)
return(result)
def saveArticleList(self,artList):
#save list as pickle file
if self.getOption('testpickle'):
pywikibot.output('PICKLING SAVE at %s ARTICLE count %i' % (datetime.now().strftime("%Y-%m-%d %H:%M:%S"),len(artList)))
with open('masti/CEESpring2020.dat', 'wb') as f:
pickle.dump(artList, f, protocol=config.pickle_protocol)
def getArticleList(self):
#generate article list
artList = []
pywikibot.output(u'GETARTICLELIST artList:%s' % artList)
#use pagegenerator to get articles linking to CEE templates
#plwiki = pywikibot.Site('pl',fam='wikipedia')
#p = pywikibot.Page( plwiki, "Szablon:CEE Spring 2020" )
#while True:
for p in self.generator:
#p = t.toggleTalkPage()
pywikibot.output(u'Treating: %s' % p.title())
d = p.data_item()
pywikibot.output(u'WD: %s' % d.title() )
dataItem = d.get()
count = 0
for i in self.genInterwiki(p):
if self.getOption('test'):
pywikibot.output('Searching for interwiki. Page:%s, Type:%s' % (i, type(i)))
lang = self.lang(i.title(asLink=True,force_interwiki=True))
if self.getOption('test'):
pywikibot.output('Searching for interwiki. Lang:%s' % lang)
#test switch
if self.getOption('short'):
if lang not in ('myv'):
continue
self.templatesList[lang] = [i.title()]
pywikibot.output(u'Getting template redirs to %s Lang:%s' % (i.title(asLink=True,force_interwiki=True), lang) )
for p in i.getReferences(namespaces=10,filter_redirects=True):
self.templatesList[lang].append(p.title())
if self.getOption('test2'):
pywikibot.output('REDIR TEMPLATE:%s' % p.title(asLink=True,force_interwiki=True))
pywikibot.output(u'Getting references to %s Lang:%s' % (i.title(asLink=True,force_interwiki=True), lang) )
if self.getOption('test2'):
pywikibot.output('REDIR TEMPLATE LIST:%s' % self.templatesList[lang])
countlang = 0
for p in i.getReferences(namespaces=1):
artParams = {}
art = p.toggleTalkPage()
if art.exists():
countlang += 1
artList.append(art)
if self.getOption('testgetart'):
pywikibot.output(u'getArticleList #%i/%i:%s:%s' % (count,countlang,lang,art.title()))
count += 1
#break
#get sk.wiki article list
return(artList)
def printArtList(self,artList):
for p in artList:
s = p.site
l = s.code
if self.getOption('test'):
pywikibot.output(u'Page lang:%s : %s' % (l, p.title(asLink=True,force_interwiki=True)))
return
def printArtInfo(self,artInfo):
#test print of article list result
#if self.getOption('testartinfo'):
# pywikibot.output(u'***************************************')
# pywikibot.output(u'** artInfo **')
# pywikibot.output(u'***************************************')
for l in artInfo.keys():
for a in artInfo[l]:
if self.getOption('testartinfo'):
pywikibot.output(a)
return
def cleanText(self,text):
# remove unnecessary parts of wikitext
text = textlib.removeDisabledParts(text)
text = textlib.removeLanguageLinks(text)
text = textlib.removeCategoryLinks(text)
return(text)
def getWordCount(self,text):
# get a word count for text
return(len(text.split()))
def getArtLength(self,text):
# get article length
return(len(text))
def cleanUsername(self,user):
# remove lang> from username
if '>' in user:
user = re.sub(r'.*\>','',user)
return(user)
def getArtInfo(self,art):
#get article language, creator, creation date
artParams = {}
talk = art.toggleTalkPage()
if art.exists():
creator, creationDate = self.getUpdater(art)
creator = self.cleanUsername(creator)
lang = art.site.code
woman = self.checkWomen(art)
artParams['title'] = art.title()
artParams['lang'] = lang
artParams['creator'] = creator
artParams['creationDate'] = creationDate
artParams['newarticle'] = self.newArticle(art)
cleantext = self.cleanText(art.text)
artParams['charcount'] = self.getArtLength(cleantext)
artParams['wordcount'] = self.getWordCount(cleantext)
if self.getOption('test2'):
pywikibot.output('artParams[ArtInfo]:%s' % artParams)
artParams['template'] = {u'country':[], 'user':creator, 'woman':woman, 'nocountry':False}
if lang in self.templatesList.keys() and talk.exists():
TmplInfo = self.getTemplateInfo(talk, self.templatesList[lang], lang)
artParams['template'] = TmplInfo
if not artParams['template']['woman']:
artParams['template']['woman'] = woman
if not len(artParams['template']['country']):
artParams['template']['nocountry'] = True
#if artParams['template']['user']:
# creator = artParams['template']['user']
if u'template' not in artParams.keys():
artParams['template'] = {u'country':[], 'user':creator, 'woman':woman, 'nocountry':True}
#if not artParams['newarticle'] :
#if artParams['newarticle'] :
# artParams['template']['user'] = creator
#if not artParams['template']['user'] :
# artParams['creator'] = artParams['template']['user']
#print artParams
if self.getOption('test2'):
pywikibot.output('artParams:%s' % artParams)
return(artParams)
def checkWomen(self,art):
#check if the article is about woman
#using WikiData
try:
d = art.data_item()
if self.getOption('test4'):
pywikibot.output(u'WD: %s (checkWomen)' % d.title() )
dataItem = d.get()
#pywikibot.output(u'DataItem:%s' % dataItem.keys() )
claims = dataItem['claims']
except:
return(False)
try:
gender = claims["P21"]
except:
return(False)
for c in gender:
cjson = c.toJSON()
genderclaim = cjson[u'mainsnak'][u'datavalue'][u'value'][u'numeric-id']
if u'6581072' == str(genderclaim):
if self.getOption('test4'):
pywikibot.output(u'%s:Woman' % art.title())
return(True)
else:
if self.getOption('test4'):
pywikibot.output(u'%s:Man' % art.title())
return(False)
return(False)
def getUpdater(self, art):
#find author and update datetime of the biggest update within CEESpring
try:
creator, creationDate = art.getCreator()
except:
return("'''UNKNOWN USER'''", "'''UNKNOWN DATE'''")
SpringStart = datetime.strptime("2020-03-20T12:00:00Z", "%Y-%m-%dT%H:%M:%SZ")
if self.newArticle(art):
if self.getOption('test3'):
pywikibot.output(u'New art creator %s:%s (T:%s)' % (art.title(asLink=True,force_interwiki=True),creator,creationDate))
return(creator, creationDate)
else:
#for rv in art.revisions(reverse=True,starttime="2017-03-20T12:00:00Z",endtime="2017-06-01T00:00:00Z"):
for rv in art.revisions(reverse=True, starttime=SpringStart):
if self.getOption('test3'):
pywikibot.output(u'updated art editor %s:%s (T:%s)' % (art.title(asLink=True,force_interwiki=True),rv.user,rv.timestamp))
if datetime.strptime(str(rv.timestamp), "%Y-%m-%dT%H:%M:%SZ") > SpringStart:
if self.getOption('test3'):
pywikibot.output(u'returning art editor %s:%s (T:%s)' % (art.title(asLink=True,force_interwiki=True),rv.user,rv.timestamp))
return(rv.user,rv.timestamp)
else:
if self.getOption('test3'):
pywikibot.output(u'Skipped returning art editor %s:%s (T:%s)' % (art.title(asLink=True,force_interwiki=True),rv.user,rv.timestamp))
#if self.getOption('test3'):
# pywikibot.output(u'updated art editor %s:%s (T:%s)' % (art.title(asLink=True,force_interwiki=True),rv['user'],rv['timestamp']))
# return(rv['user'],rv['timestamp'])
return("'''UNKNOWN USER'''", creationDate)
def newArticle(self,art):
#check if the article was created within CEE Spring
try:
creator, creationDate = art.getCreator()
except:
pywikibot.output('EXCEPTION: newArticle')
return(False)
SpringStart = datetime.strptime("2020-03-20T12:00:00Z", "%Y-%m-%dT%H:%M:%SZ")
SpringEnd = datetime.strptime("2020-06-01T00:00:00Z", "%Y-%m-%dT%H:%M:%SZ")
return ( datetime.strptime(creationDate, "%Y-%m-%dT%H:%M:%SZ") > SpringStart )
def userName(self,text):
#extract username from template param value
uNameR = re.compile(r'.*?:(?P<username>.*)')
if self.getOption('testusername'):
pywikibot.output('userName:%s' % text)
if '[' in text:
uName = uNameR.match(text)
if uName:
return(uName.group('username'))
else:
return(None)
elif not len(text):
return(None)
else:
return(text)
def getTemplateInfo(self,page,template,lang):
param = {}
#author, creationDate = self.getUpdater(page)
parlist = {'country':[],'user':None,'woman':False, 'nocountry':False}
#return dictionary with template params
for t in page.templatesWithParams():
title, params = t
#print(title)
#print(params)
tt = re.sub(r'\[\[.*?:(.*?)\]\]', r'\1', title.title())
if self.getOption('test2'):
pywikibot.output(u'tml:%s * %s * %s' % (title,tt,template) )
if tt in template:
paramcount = 1
countryDef = False # check if country defintion exists
parlist['woman'] = False
parlist['country'] = []
parlist['user'] = None
for p in params:
named, name, value = self.templateArg(p)
# strip square brackets from value
if lang == 'myv' and name.startswith(self.countryp['myv']):
value = re.sub(r"\'*\{\{Масторкоцт *\| *([^\}]*)[^\n]*", r'\1', value)
else:
value = re.sub(r"\'*\[*([^\]\|\']*).*", r'\1', value)
if not named:
name = str(paramcount)
param[name] = value
paramcount += 1
if self.getOption('test2'):
pywikibot.output(u'p:%s' % p )
#check username in template
if lang in self.userp.keys() and name.lower().startswith(self.userp[lang].lower()):
if self.getOption('test'):
pywikibot.output(u'user:%s:%s' % (name,value))
#if lang in self.userp.keys() and value.lower().startswith(self.userp[lang].lower()):
# parlist['user'] = value
parlist['user'] = self.userName(value)
if self.getOption('testusername'):
pywikibot.output('[[%s]] par value:%s' % (page.title(),value))
pywikibot.output('[[%s]] username:%s' % (page.title(),parlist['user']))
#check article about women
if lang in self.topicp.keys() and name.lower().startswith(self.topicp[lang].lower()):
if self.getOption('test2'):
pywikibot.output(u'topic:%s:%s' % (name,value))
if lang in self.womenp.keys() and value.lower().startswith(self.womenp[lang].lower()):
#self.women[lang] += 1
parlist['woman'] = True
#check article about country
if lang in self.countryp.keys() and name.lower().startswith(self.countryp[lang].lower()):
if self.getOption('test2'):
pywikibot.output(u'country:%s:%s:%i' % (name,value,len(value)))
if len(value)>0:
countryDef = True
if lang in countryNames.keys() and value in (countryNames[lang].keys()):
countryEN = countryNames[lang][value]
if self.getOption('test2'):
pywikibot.output(u'countryEN:%s (%s)' % (countryEN,value))
if not countryEN in parlist['country']:
if self.getOption('test2'):
pywikibot.output(u'appending countryEN:%s' % countryEN)
parlist['country'].append(countryEN)
if lang not in self.pagesCount.keys():
self.pagesCount[lang] = {}
if countryEN in self.pagesCount[lang].keys():
self.pagesCount[lang][countryEN] += 1
else:
self.pagesCount[lang][countryEN] = 1
else:
if not value in parlist['country']:
if self.getOption('test2'):
pywikibot.output(u'appending other country:%s' % value)
parlist['country'].append(value)
self.otherCountriesList[lang].append(value)
if self.getOption('test'):
pywikibot.output(self.pagesCount)
if self.getOption('test3'):
#pywikibot.output(u'PARAM:%s' % param)
pywikibot.output(u'PARLIST:%s' % parlist)
return parlist
return parlist
def lang(self,template):
return(re.sub(r'\[\[(.*?):.*?\]\]',r'\1',template))
def genInterwiki(self,page):
# yield interwiki sites generator
iw = []
iw.append(page)
try:
for s in page.iterlanglinks():
if self.getOption('testinterwiki'):
pywikibot.output(u'SL iw: %s' % s)
spage = pywikibot.Page(s)
if self.getOption('testinterwiki'):
pywikibot.output(u'SL spage')
pywikibot.output(u'gI Page: %s' % spage.title(force_interwiki=True) )
iw.append( spage )
print( iw)
except Exception as e:
pywikibot.output('genInterwiki EXCEPTION %s' % str(e))
pass
#print(iw)
return(iw)
def generateOtherCountriesTable(self, res, pagename, header, footer):
"""
Generates results page from res
Starting with header, ending with footer
Output page is pagename
"""
locpagename = re.sub(r'.*:','',pagename)
finalpage = header
if self.getOption('test'):
pywikibot.output(u'**************************')
pywikibot.output(u'generateOtherCountriesTable')
pywikibot.output(u'**************************')
pywikibot.output(u'OtherCountries:%s' % self.otherCountriesList)
for c in self.otherCountriesList.keys():
finalpage += u'\n== ' + c + u' =='
pywikibot.output('== ' + c + u' ==')
for i in self.otherCountriesList[c]:
pywikibot.output('c:%s, i:%s' % (c,i))
finalpage += u'\n# <nowiki>' + i + u'</nowiki>'
finalpage += footer
outpage = pywikibot.Page(pywikibot.Site(), pagename)
if self.getOption('test') or self.getOption('progress'):
pywikibot.output(u'OtherCountries:%s' % outpage.title())
outpage.text = finalpage
outpage.save(summary=self.getOption('summary'))
if self.getOption('test') or self.getOption('progress'):
pywikibot.output(u'OtherCountries SAVED')
return
def generateResultCountryTable(self, res, pagename, header, footer):
"""
Generates results page from res
Starting with header, ending with footer
Output page is pagename
"""
locpagename = re.sub(r'.*:','',pagename)
finalpage = header
if self.getOption('test'):
pywikibot.output(u'**************************')
pywikibot.output(u'generateResultCountryTable')
pywikibot.output(u'**************************')
#total counters
countryTotals = {}
for c in countryList:
countryTotals[c] = 0
# generate table header
finalpage += u'\n{| class="wikitable sortable" style="text-align: center;"'
finalpage += u'\n|-'
finalpage += u'\n! {{Vert header|stp=1|Wiki / Country}}'
finalpage += u' !! {{Vert header|stp=1|Total}} '
for c in countryList:
finalpage += u' !! {{Vert header|stp=1|%s}}' % c
finalpage += u' !! {{Vert header|stp=1|Total}} !! {{Vert header|stp=1|Wiki / Country}}'
# generate table rows
for wiki in res.keys():
finalpage += u'\n|-'
finalpage += u'\n| [[' + locpagename + u'/Article list#'+ wiki + u'.wikipedia|' + wiki + u']]'
wikiTotal = 0 # get the row total
newline = '' # keep info for the table row
for c in countryList:
#newline += u' || '
if u'Other' in c:
if self.getOption('test5'):
pywikibot.output(u'other:%s' % c)
pywikibot.output(u'res[wiki]:%s' % res[wiki])
otherCountry = 0 # count other countries
for country in res[wiki]:
if country not in countryList and not country==u'':
if self.getOption('test5'):
pywikibot.output(u'country:%s ** otherCountry=%i+%i=%i' % \
(country,otherCountry,res[wiki][country],otherCountry+res[wiki][country]))
otherCountry += res[wiki][country]
newline += ' || ' + str(otherCountry)
wikiTotal += otherCountry # add to wiki total
countryTotals[c] += otherCountry
else:
if self.getOption('test5'):
pywikibot.output('c:%s, wiki:%s' % (c, wiki))