Skip to content

Commit 68d2128

Browse files
committed
fix linter issues
1 parent c408146 commit 68d2128

File tree

3 files changed

+75
-69
lines changed

3 files changed

+75
-69
lines changed

docs/source/examples/Drag and Drop examples.ipynb renamed to docs/source/examples/Drag and Drop.ipynb

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 11,
19+
"execution_count": 1,
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
@@ -46,7 +46,7 @@
4646
{
4747
"data": {
4848
"application/vnd.jupyter.widget-view+json": {
49-
"model_id": "460d334fd7214373bf6512e94b48d350",
49+
"model_id": "98fccc59219d44a6b0cb8eae0562b46e",
5050
"version_major": 2,
5151
"version_minor": 0
5252
},
@@ -78,7 +78,7 @@
7878
{
7979
"data": {
8080
"application/vnd.jupyter.widget-view+json": {
81-
"model_id": "29b71c8d69c6441e942d03cd4da671e1",
81+
"model_id": "65e6ec5eb86b410cbce29f07dd846385",
8282
"version_major": 2,
8383
"version_minor": 0
8484
},
@@ -117,7 +117,7 @@
117117
{
118118
"data": {
119119
"application/vnd.jupyter.widget-view+json": {
120-
"model_id": "d3aac4a1f8b846db8e27495d904682b5",
120+
"model_id": "c113a1c95285465592ee98227120f597",
121121
"version_major": 2,
122122
"version_minor": 0
123123
},
@@ -150,7 +150,7 @@
150150
{
151151
"data": {
152152
"application/vnd.jupyter.widget-view+json": {
153-
"model_id": "c0082b4380d743beabd1397071ec41f6",
153+
"model_id": "4af0471abc3a4a5095ca121766948b60",
154154
"version_major": 2,
155155
"version_minor": 0
156156
},
@@ -166,7 +166,7 @@
166166
"name": "stdout",
167167
"output_type": "stream",
168168
"text": [
169-
"{'text/plain': 'Drag me', 'application/vnd.jupyter.widget-view+json': 'd3aac4a1f8b846db8e27495d904682b5', 'widget': DraggableBox(child=Label(value='Drag me'))}\n"
169+
"{'text/plain': 'Drag me', 'application/vnd.jupyter.widget-view+json': 'c113a1c95285465592ee98227120f597', 'widget': DraggableBox(child=Label(value='Drag me'))}\n"
170170
]
171171
}
172172
],
@@ -224,7 +224,7 @@
224224
{
225225
"data": {
226226
"application/vnd.jupyter.widget-view+json": {
227-
"model_id": "ef9e91fbcd2c45089f8897d72af12845",
227+
"model_id": "d4ca90bafedf4a1fa7b2e57d3d2b3387",
228228
"version_major": 2,
229229
"version_minor": 0
230230
},
@@ -259,7 +259,7 @@
259259
{
260260
"data": {
261261
"application/vnd.jupyter.widget-view+json": {
262-
"model_id": "58d2f51d1b29455fabe519278478f69f",
262+
"model_id": "46ade71e68a0435f81fc7de391d6abba",
263263
"version_major": 2,
264264
"version_minor": 0
265265
},
@@ -299,21 +299,21 @@
299299
},
300300
{
301301
"cell_type": "code",
302-
"execution_count": 12,
302+
"execution_count": 9,
303303
"metadata": {},
304304
"outputs": [
305305
{
306306
"data": {
307307
"application/vnd.jupyter.widget-view+json": {
308-
"model_id": "67a49e632f3a48ecb0588ff21910b818",
308+
"model_id": "21d9bcd6218447169ffe194cacc120e6",
309309
"version_major": 2,
310310
"version_minor": 0
311311
},
312312
"text/plain": [
313313
"DraggableBox(child=Label(value='Drag me'))"
314314
]
315315
},
316-
"execution_count": 12,
316+
"execution_count": 9,
317317
"metadata": {},
318318
"output_type": "execute_result"
319319
}
@@ -327,21 +327,21 @@
327327
},
328328
{
329329
"cell_type": "code",
330-
"execution_count": 13,
330+
"execution_count": 10,
331331
"metadata": {},
332332
"outputs": [
333333
{
334334
"data": {
335335
"application/vnd.jupyter.widget-view+json": {
336-
"model_id": "29474f46942d4ecb85b97ca1ee3530e4",
336+
"model_id": "715966a4cc4d4edfbd6ba181a08d80bd",
337337
"version_major": 2,
338338
"version_minor": 0
339339
},
340340
"text/plain": [
341341
"DropBox(child=VBox(children=(Label(value='Drop here'),)), layout=Layout(height='100px', width='200px'))"
342342
]
343343
},
344-
"execution_count": 13,
344+
"execution_count": 10,
345345
"metadata": {},
346346
"output_type": "execute_result"
347347
}
@@ -381,23 +381,23 @@
381381
},
382382
{
383383
"cell_type": "code",
384-
"execution_count": 14,
384+
"execution_count": 11,
385385
"metadata": {
386386
"scrolled": true
387387
},
388388
"outputs": [
389389
{
390390
"data": {
391391
"application/vnd.jupyter.widget-view+json": {
392-
"model_id": "bb57d5bec390451d8766fbfb7d1f983f",
392+
"model_id": "75e49d2a1548473cb3490dbf8609dc31",
393393
"version_major": 2,
394394
"version_minor": 0
395395
},
396396
"text/plain": [
397397
"DraggableBox(child=Label(value='Drag me'), drag_data={'application/custom-data': 'Custom data'})"
398398
]
399399
},
400-
"execution_count": 14,
400+
"execution_count": 11,
401401
"metadata": {},
402402
"output_type": "execute_result"
403403
}
@@ -410,21 +410,21 @@
410410
},
411411
{
412412
"cell_type": "code",
413-
"execution_count": 15,
413+
"execution_count": 12,
414414
"metadata": {},
415415
"outputs": [
416416
{
417417
"data": {
418418
"application/vnd.jupyter.widget-view+json": {
419-
"model_id": "c7e766365bf54ac4966d4f03fca04258",
419+
"model_id": "8ba49ae0ee34481399031c482cb1debc",
420420
"version_major": 2,
421421
"version_minor": 0
422422
},
423423
"text/plain": [
424424
"DropBox(child=Label(value='Drop here'))"
425425
]
426426
},
427-
"execution_count": 15,
427+
"execution_count": 12,
428428
"metadata": {},
429429
"output_type": "execute_result"
430430
}
@@ -468,7 +468,7 @@
468468
},
469469
{
470470
"cell_type": "code",
471-
"execution_count": 16,
471+
"execution_count": 13,
472472
"metadata": {},
473473
"outputs": [],
474474
"source": [
@@ -477,21 +477,21 @@
477477
},
478478
{
479479
"cell_type": "code",
480-
"execution_count": 17,
480+
"execution_count": 14,
481481
"metadata": {},
482482
"outputs": [
483483
{
484484
"data": {
485485
"application/vnd.jupyter.widget-view+json": {
486-
"model_id": "246675c70be544cf9202e3cdb804f99b",
486+
"model_id": "661bd735e4604ac792e10bb609b163d6",
487487
"version_major": 2,
488488
"version_minor": 0
489489
},
490490
"text/plain": [
491491
"DraggableBox(child=IntSlider(value=0, description='Drag me', layout=Layout(width='250px')))"
492492
]
493493
},
494-
"execution_count": 17,
494+
"execution_count": 14,
495495
"metadata": {},
496496
"output_type": "execute_result"
497497
}
@@ -503,7 +503,7 @@
503503
},
504504
{
505505
"cell_type": "code",
506-
"execution_count": 18,
506+
"execution_count": 15,
507507
"metadata": {},
508508
"outputs": [],
509509
"source": [
@@ -513,21 +513,21 @@
513513
},
514514
{
515515
"cell_type": "code",
516-
"execution_count": 19,
516+
"execution_count": 16,
517517
"metadata": {},
518518
"outputs": [
519519
{
520520
"data": {
521521
"application/vnd.jupyter.widget-view+json": {
522-
"model_id": "62af6c1abfa6492c8e6351b4b0ad7f25",
522+
"model_id": "26d319118d0e4e16826f4c5ca8ce479e",
523523
"version_major": 2,
524524
"version_minor": 0
525525
},
526526
"text/plain": [
527527
"DropBox(child=VBox(children=(Label(value='Drop sliders below'),), layout=Layout(height='150px', width='350px')…"
528528
]
529529
},
530-
"execution_count": 19,
530+
"execution_count": 16,
531531
"metadata": {},
532532
"output_type": "execute_result"
533533
}
@@ -554,7 +554,7 @@
554554
},
555555
{
556556
"cell_type": "code",
557-
"execution_count": 20,
557+
"execution_count": 17,
558558
"metadata": {},
559559
"outputs": [],
560560
"source": [
@@ -565,7 +565,7 @@
565565
},
566566
{
567567
"cell_type": "code",
568-
"execution_count": 21,
568+
"execution_count": 18,
569569
"metadata": {},
570570
"outputs": [],
571571
"source": [
@@ -588,7 +588,7 @@
588588
},
589589
{
590590
"cell_type": "code",
591-
"execution_count": 22,
591+
"execution_count": 19,
592592
"metadata": {},
593593
"outputs": [],
594594
"source": [
@@ -603,21 +603,21 @@
603603
},
604604
{
605605
"cell_type": "code",
606-
"execution_count": 23,
606+
"execution_count": 20,
607607
"metadata": {},
608608
"outputs": [
609609
{
610610
"data": {
611611
"application/vnd.jupyter.widget-view+json": {
612-
"model_id": "44b808f2cc8b4e10867545279e833d68",
612+
"model_id": "2477925b3bc9403892c7ea797b5fe82f",
613613
"version_major": 2,
614614
"version_minor": 0
615615
},
616616
"text/plain": [
617617
"GridspecLayout(children=(DraggableBox(child=Label(value='col1'), drag_data={'data/app': '[4, 2, 1]'}, layout=L…"
618618
]
619619
},
620-
"execution_count": 23,
620+
"execution_count": 20,
621621
"metadata": {},
622622
"output_type": "execute_result"
623623
}
@@ -640,21 +640,21 @@
640640
},
641641
{
642642
"cell_type": "code",
643-
"execution_count": 25,
643+
"execution_count": 21,
644644
"metadata": {},
645645
"outputs": [
646646
{
647647
"data": {
648648
"application/vnd.jupyter.widget-view+json": {
649-
"model_id": "f94865838f714367877f60b8ab699426",
649+
"model_id": "e0dd3bf734be402a8c93857bb78f773b",
650650
"version_major": 2,
651651
"version_minor": 0
652652
},
653653
"text/plain": [
654-
"DropBox(child=Figure(axes=[Axis(scale=LinearScale(), side='bottom'), Axis(orientation='vertical', scale=Linear"
654+
"DropBox(child=Label(value='Drag data from the table and drop it here.'), layout=Layout(height='500px', width='"
655655
]
656656
},
657-
"execution_count": 25,
657+
"execution_count": 21,
658658
"metadata": {},
659659
"output_type": "execute_result"
660660
}
@@ -679,7 +679,7 @@
679679
},
680680
{
681681
"cell_type": "code",
682-
"execution_count": 26,
682+
"execution_count": 22,
683683
"metadata": {},
684684
"outputs": [],
685685
"source": [
@@ -742,21 +742,21 @@
742742
},
743743
{
744744
"cell_type": "code",
745-
"execution_count": 27,
745+
"execution_count": 23,
746746
"metadata": {},
747747
"outputs": [
748748
{
749749
"data": {
750750
"application/vnd.jupyter.widget-view+json": {
751-
"model_id": "b4a88100b0004784b18acecaedf02e3c",
751+
"model_id": "7647ef70e93743fd83a19b916f1bb73c",
752752
"version_major": 2,
753753
"version_minor": 0
754754
},
755755
"text/plain": [
756756
"HBox(children=(DraggableBox(child=SelectMultiple(description='Fruits', index=(1,), options=('Apples', 'Oranges…"
757757
]
758758
},
759-
"execution_count": 27,
759+
"execution_count": 23,
760760
"metadata": {},
761761
"output_type": "execute_result"
762762
}

ipywidgets/widgets/widget_dragdrop.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ def _handle_dragdrop_msg(self, _, content, buffers):
6565
class DropBox(DropWidget):
6666
_model_name = Unicode('DropBoxModel').tag(sync=True)
6767
_view_name = Unicode('DropBoxView').tag(sync=True)
68-
child = Instance(Widget).tag(sync=True, **widget_serialization)
68+
child = Instance(Widget, allow_none=True).tag(sync=True, **widget_serialization)
6969

70-
def __init__(self, child, *args, **kwargs):
71-
super(DropBox, self).__init__(*args, **kwargs, child=child)
70+
def __init__(self, child=None, **kwargs):
71+
super(DropBox, self).__init__(**kwargs, child=child)
7272

7373
@register
7474
class DraggableBox(DropWidget):
7575
_model_name = Unicode('DraggableBoxModel').tag(sync=True)
7676
_view_name = Unicode('DraggableBoxView').tag(sync=True)
77-
child = Instance(Widget).tag(sync=True, **widget_serialization)
77+
child = Instance(Widget, allow_none=True).tag(sync=True, **widget_serialization)
7878
draggable = Bool(True).tag(sync=True)
7979
drag_data = Dict().tag(sync=True)
8080

81-
def __init__(self, child, *args, **kwargs):
82-
super(DraggableBox, self).__init__(*args, **kwargs, child=child)
81+
def __init__(self, child=None, **kwargs):
82+
super(DraggableBox, self).__init__(**kwargs, child=child)

0 commit comments

Comments
 (0)