@@ -76,9 +76,10 @@ def type_str(v):
76
76
# Validators
77
77
# ----------
78
78
class BaseValidator :
79
- def __init__ (self , plotly_name , parent_name ):
79
+ def __init__ (self , plotly_name , parent_name , role = None , ** _ ):
80
80
self .parent_name = parent_name
81
81
self .plotly_name = plotly_name
82
+ self .role = role
82
83
83
84
def validate_coerce (self , v ):
84
85
raise NotImplementedError ()
@@ -129,8 +130,9 @@ class DataArrayValidator(BaseValidator):
129
130
},
130
131
"""
131
132
132
- def __init__ (self , plotly_name , parent_name , ** _ ):
133
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
133
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
134
+ super ().__init__ (plotly_name = plotly_name ,
135
+ parent_name = parent_name , ** kwargs )
134
136
135
137
def description (self ):
136
138
return ("""\
@@ -163,8 +165,12 @@ class EnumeratedValidator(BaseValidator):
163
165
]
164
166
},
165
167
"""
166
- def __init__ (self , plotly_name , parent_name , values , array_ok = False , coerce_number = False , ** _ ):
167
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
168
+ def __init__ (self , plotly_name , parent_name , values ,
169
+ array_ok = False ,
170
+ coerce_number = False ,
171
+ ** kwargs ):
172
+ super ().__init__ (plotly_name = plotly_name ,
173
+ parent_name = parent_name , ** kwargs )
168
174
169
175
# coerce_number is rarely used and not implemented
170
176
self .coerce_number = coerce_number
@@ -298,8 +304,9 @@ class BooleanValidator(BaseValidator):
298
304
]
299
305
},
300
306
"""
301
- def __init__ (self , plotly_name , parent_name , ** _ ):
302
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
307
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
308
+ super ().__init__ (plotly_name = plotly_name ,
309
+ parent_name = parent_name , ** kwargs )
303
310
304
311
def description (self ):
305
312
return ("""\
@@ -329,8 +336,10 @@ class NumberValidator(BaseValidator):
329
336
]
330
337
},
331
338
"""
332
- def __init__ (self , plotly_name , parent_name , min = None , max = None , array_ok = False , ** _ ):
333
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
339
+ def __init__ (self , plotly_name , parent_name ,
340
+ min = None , max = None , array_ok = False , ** kwargs ):
341
+ super ().__init__ (plotly_name = plotly_name ,
342
+ parent_name = parent_name , ** kwargs )
334
343
335
344
# Handle min
336
345
if min is None and max is not None :
@@ -417,8 +426,10 @@ class IntegerValidator(BaseValidator):
417
426
]
418
427
},
419
428
"""
420
- def __init__ (self , plotly_name , parent_name , min = None , max = None , array_ok = False , ** _ ):
421
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
429
+ def __init__ (self , plotly_name , parent_name ,
430
+ min = None , max = None , array_ok = False , ** kwargs ):
431
+ super ().__init__ (plotly_name = plotly_name ,
432
+ parent_name = parent_name , ** kwargs )
422
433
423
434
# Handle min
424
435
if min is None and max is not None :
@@ -512,8 +523,11 @@ class StringValidator(BaseValidator):
512
523
]
513
524
},
514
525
"""
515
- def __init__ (self , plotly_name , parent_name , no_blank = False , strict = False , array_ok = False , values = None , ** _ ):
516
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
526
+ def __init__ (self , plotly_name , parent_name ,
527
+ no_blank = False , strict = False , array_ok = False , values = None ,
528
+ ** kwargs ):
529
+ super ().__init__ (plotly_name = plotly_name ,
530
+ parent_name = parent_name , ** kwargs )
517
531
self .no_blank = no_blank
518
532
self .strict = strict # Not implemented. We're always strict
519
533
self .array_ok = array_ok
@@ -613,8 +627,10 @@ class ColorValidator(BaseValidator):
613
627
"slateblue" , "slategray" , "slategrey" , "snow" , "springgreen" , "steelblue" , "tan" , "teal" , "thistle" , "tomato" ,
614
628
"turquoise" , "violet" , "wheat" , "white" , "whitesmoke" , "yellow" , "yellowgreen" ]
615
629
616
- def __init__ (self , plotly_name , parent_name , array_ok = False , colorscale_path = None , ** _ ):
617
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
630
+ def __init__ (self , plotly_name , parent_name ,
631
+ array_ok = False , colorscale_path = None , ** kwargs ):
632
+ super ().__init__ (plotly_name = plotly_name ,
633
+ parent_name = parent_name , ** kwargs )
618
634
self .colorscale_path = colorscale_path
619
635
self .array_ok = array_ok
620
636
@@ -718,8 +734,9 @@ class ColorlistValidator(BaseValidator):
718
734
]
719
735
}
720
736
"""
721
- def __init__ (self , plotly_name , parent_name , ** _ ):
722
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
737
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
738
+ super ().__init__ (plotly_name = plotly_name ,
739
+ parent_name = parent_name , ** kwargs )
723
740
724
741
def description (self ):
725
742
return ("""\
@@ -758,8 +775,9 @@ class ColorscaleValidator(BaseValidator):
758
775
named_colorscales = ['Greys' , 'YlGnBu' , 'Greens' , 'YlOrRd' , 'Bluered' , 'RdBu' , 'Reds' , 'Blues' , 'Picnic' ,
759
776
'Rainbow' , 'Portland' , 'Jet' , 'Hot' , 'Blackbody' , 'Earth' , 'Electric' , 'Viridis' ]
760
777
761
- def __init__ (self , plotly_name , parent_name , ** _ ):
762
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
778
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
779
+ super ().__init__ (plotly_name = plotly_name ,
780
+ parent_name = parent_name , ** kwargs )
763
781
764
782
def description (self ):
765
783
desc = """\
@@ -817,8 +835,9 @@ class AngleValidator(BaseValidator):
817
835
]
818
836
},
819
837
"""
820
- def __init__ (self , plotly_name , parent_name , ** _ ):
821
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
838
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
839
+ super ().__init__ (plotly_name = plotly_name ,
840
+ parent_name = parent_name , ** kwargs )
822
841
823
842
def description (self ):
824
843
desc = """\
@@ -851,8 +870,9 @@ class SubplotidValidator(BaseValidator):
851
870
"otherOpts": []
852
871
},
853
872
"""
854
- def __init__ (self , plotly_name , parent_name , dflt , ** _ ):
855
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
873
+ def __init__ (self , plotly_name , parent_name , dflt , ** kwargs ):
874
+ super ().__init__ (plotly_name = plotly_name ,
875
+ parent_name = parent_name , ** kwargs )
856
876
self .base = dflt
857
877
self .regex = dflt + "(\d*)"
858
878
@@ -904,8 +924,10 @@ class FlaglistValidator(BaseValidator):
904
924
]
905
925
},
906
926
"""
907
- def __init__ (self , plotly_name , parent_name , flags , extras = None , array_ok = False , ** _ ):
908
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
927
+ def __init__ (self , plotly_name , parent_name , flags ,
928
+ extras = None , array_ok = False , ** kwargs ):
929
+ super ().__init__ (plotly_name = plotly_name ,
930
+ parent_name = parent_name , ** kwargs )
909
931
self .flags = flags
910
932
self .extras = extras if extras is not None else []
911
933
self .array_ok = array_ok
@@ -988,8 +1010,10 @@ class AnyValidator(BaseValidator):
988
1010
]
989
1011
},
990
1012
"""
991
- def __init__ (self , plotly_name , parent_name , values = None , array_ok = False , ** _ ):
992
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1013
+ def __init__ (self , plotly_name , parent_name ,
1014
+ values = None , array_ok = False , ** kwargs ):
1015
+ super ().__init__ (plotly_name = plotly_name ,
1016
+ parent_name = parent_name , ** kwargs )
993
1017
self .values = values
994
1018
self .array_ok = array_ok
995
1019
@@ -1023,8 +1047,10 @@ class InfoArrayValidator(BaseValidator):
1023
1047
]
1024
1048
}
1025
1049
"""
1026
- def __init__ (self , plotly_name , parent_name , items , free_length = None , ** _ ):
1027
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1050
+ def __init__ (self , plotly_name , parent_name ,
1051
+ items , free_length = None , ** kwargs ):
1052
+ super ().__init__ (plotly_name = plotly_name ,
1053
+ parent_name = parent_name , ** kwargs )
1028
1054
self .items = items
1029
1055
1030
1056
self .item_validators = []
@@ -1093,8 +1119,9 @@ class ImageUriValidator(BaseValidator):
1093
1119
except ModuleNotFoundError :
1094
1120
pass
1095
1121
1096
- def __init__ (self , plotly_name , parent_name , ** _ ):
1097
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1122
+ def __init__ (self , plotly_name , parent_name , ** kwargs ):
1123
+ super ().__init__ (plotly_name = plotly_name ,
1124
+ parent_name = parent_name , ** kwargs )
1098
1125
1099
1126
def description (self ):
1100
1127
@@ -1133,11 +1160,13 @@ def validate_coerce(self, v):
1133
1160
1134
1161
1135
1162
class CompoundValidator (BaseValidator ):
1136
- def __init__ (self , plotly_name , parent_name , data_class , data_docs ):
1137
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1163
+ def __init__ (self , plotly_name , parent_name ,
1164
+ data_class_str , data_docs , ** kwargs ):
1165
+ super ().__init__ (plotly_name = plotly_name ,
1166
+ parent_name = parent_name , ** kwargs )
1138
1167
1139
1168
# Save element class string
1140
- self .data_class_str = data_class
1169
+ self .data_class_str = data_class_str
1141
1170
self ._data_class = None
1142
1171
self .data_docs = data_docs
1143
1172
self .module_str = CompoundValidator .compute_graph_obj_module_str (
@@ -1215,14 +1244,16 @@ def validate_coerce(self, v):
1215
1244
1216
1245
1217
1246
class CompoundArrayValidator (BaseValidator ):
1218
- def __init__ (self , plotly_name , parent_name , element_class , element_docs ):
1219
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1247
+ def __init__ (self , plotly_name , parent_name ,
1248
+ data_class_str , data_docs , ** kwargs ):
1249
+ super ().__init__ (plotly_name = plotly_name ,
1250
+ parent_name = parent_name , ** kwargs )
1220
1251
1221
1252
# Save element class string
1222
- self .data_class_str = element_class
1253
+ self .data_class_str = data_class_str
1223
1254
self ._data_class = None
1224
1255
1225
- self .data_docs = element_docs
1256
+ self .data_docs = data_docs
1226
1257
self .module_str = CompoundValidator .compute_graph_obj_module_str (
1227
1258
self .data_class_str , parent_name )
1228
1259
@@ -1283,8 +1314,9 @@ def validate_coerce(self, v):
1283
1314
1284
1315
1285
1316
class BaseDataValidator (BaseValidator ):
1286
- def __init__ (self , class_map , plotly_name , parent_name ):
1287
- super ().__init__ (plotly_name = plotly_name , parent_name = parent_name )
1317
+ def __init__ (self , class_map , plotly_name , parent_name , ** kwargs ):
1318
+ super ().__init__ (plotly_name = plotly_name ,
1319
+ parent_name = parent_name , ** kwargs )
1288
1320
self .class_strs_map = class_map
1289
1321
self ._class_map = None
1290
1322
0 commit comments