@@ -35,7 +35,9 @@ def magics_class(cls):
35
35
36
36
def cell_magic (name ):
37
37
def decorator (func ):
38
- return func
38
+ def wrapper (self , line , cell ):
39
+ return func (self , line , cell )
40
+ return wrapper
39
41
40
42
return decorator
41
43
@@ -54,36 +56,56 @@ def __init__(self, *args, **kwargs):
54
56
55
57
# Mock widgets module
56
58
class widgets : # type: ignore
59
+ class Layout :
60
+ def __init__ (self , * args , ** kwargs ):
61
+ self .display = ""
62
+ self .border = ""
63
+ for key , value in kwargs .items ():
64
+ setattr (self , key , value )
65
+
57
66
class Dropdown :
58
67
def __init__ (self , * args , ** kwargs ):
59
68
self .value = kwargs .get ("value" )
60
69
self .options = kwargs .get ("options" , [])
70
+ self .layout = widgets .Layout ()
61
71
62
72
def observe (self , * args , ** kwargs ):
63
73
pass
64
74
65
75
class Button :
66
76
def __init__ (self , * args , ** kwargs ):
67
- pass
77
+ self . layout = widgets . Layout ()
68
78
69
79
def on_click (self , * args , ** kwargs ):
70
80
pass
71
81
72
82
class Text :
73
83
def __init__ (self , * args , ** kwargs ):
74
84
self .value = kwargs .get ("value" , "" )
85
+ self .layout = widgets .Layout ()
86
+
87
+ def observe (self , * args , ** kwargs ):
88
+ pass
75
89
76
90
class IntText :
77
91
def __init__ (self , * args , ** kwargs ):
78
92
self .value = kwargs .get ("value" , 0 )
93
+ self .layout = widgets .Layout ()
94
+
95
+ def observe (self , * args , ** kwargs ):
96
+ pass
79
97
80
98
class Textarea :
81
99
def __init__ (self , * args , ** kwargs ):
82
100
self .value = kwargs .get ("value" , "" )
101
+ self .layout = widgets .Layout ()
102
+
103
+ def observe (self , * args , ** kwargs ):
104
+ pass
83
105
84
106
class Output :
85
107
def __init__ (self , * args , ** kwargs ):
86
- pass
108
+ self . layout = widgets . Layout ()
87
109
88
110
def clear_output (self , * args , ** kwargs ):
89
111
pass
@@ -97,23 +119,23 @@ def __exit__(self, *args):
97
119
class VBox :
98
120
def __init__ (self , * args , ** kwargs ):
99
121
self .children = args [0 ] if args else []
122
+ self .layout = widgets .Layout ()
100
123
101
124
class HBox :
102
125
def __init__ (self , * args , ** kwargs ):
103
126
self .children = args [0 ] if args else []
127
+ self .layout = widgets .Layout ()
104
128
105
129
class HTML :
106
130
def __init__ (self , * args , ** kwargs ):
107
131
self .value = args [0 ] if args else ""
108
-
109
- class Layout :
110
- def __init__ (self , * args , ** kwargs ):
111
- pass
132
+ self .layout = widgets .Layout ()
112
133
113
134
class Accordion :
114
135
def __init__ (self , * args , ** kwargs ):
115
136
self .children = args [0 ] if args else []
116
137
self .selected_index = None
138
+ self .layout = widgets .Layout ()
117
139
118
140
def set_title (self , * args , ** kwargs ):
119
141
pass
0 commit comments