TeamHG-Memex / Formasaurus
Showing 1 of 1 files from the diff.

@@ -15,6 +15,8 @@
Loading
15 15
)
16 16
from formasaurus.utils import inverse_mapping, download
17 17
18 +
out = widgets.Output()
19 +
18 20
19 21
def AddPageWidget(storage):
20 22
    """
@@ -59,7 +61,9 @@
Loading
59 61
            widget
60 62
        ])
61 63
62 -
    def on_change(name, value):
64 +
    def on_change(change):
65 +
        value = change['new']
66 +
63 67
        for i in rendered:
64 68
            rendered[i].close()
65 69
@@ -71,10 +75,12 @@
Loading
71 75
        if save_func:
72 76
            save_func()
73 77
74 -
        display(rendered[value])
78 +
        with out:
79 +
            display(rendered[value])
75 80
76 -
    slider.on_trait_change(on_change, 'value')
77 -
    on_change('value', slider.value)
81 +
    slider.observe(on_change, names='value')
82 +
    on_change({'new': slider.value})
83 +
    display(out)
78 84
79 85
80 86
def FormAnnotator(ann, annotate_fields=True, annotate_types=True, max_fields=80):
@@ -140,10 +146,10 @@
Loading
140 146
        description='form type:',
141 147
    )
142 148
143 -
    def on_change(name, value):
144 -
        ann.info['forms'][ann.index] = form_types[value]
149 +
    def on_change(change):
150 +
        ann.info['forms'][ann.index] = form_types[change['new']]
145 151
146 -
    type_select.on_trait_change(on_change, 'value')
152 +
    type_select.observe(on_change, names='value')
147 153
    return type_select
148 154
149 155
@@ -157,10 +163,10 @@
Loading
157 163
        value=field_types_inv[tp],
158 164
    )
159 165
160 -
    def on_change(name, value):
161 -
        ann.fields[field_name] = field_types[value]
166 +
    def on_change(change):
167 +
        ann.fields[field_name] = field_types[change['new']]
162 168
163 -
    type_select.on_trait_change(on_change, 'value')
169 +
    type_select.observe(on_change, names='value')
164 170
    return type_select
165 171
166 172
@@ -188,8 +194,8 @@
Loading
188 194
        kw['color'] = "#777"
189 195
    kw.update(kwargs)
190 196
    style = '; '.join([
191 -
        'white-space:pre-wrap',
192 -
        'max-width:800px',
197 +
        'white-space:normal',
198 +
        'max-width:inherit',
193 199
        'word-wrap:break-word',
194 200
        'font-family:monospace',
195 201
        'overflow:scroll',
Files Coverage
formasaurus 74.51%
Project Totals (13 files) 74.51%
153.4
TRAVIS_PYTHON_VERSION=3.5
TRAVIS_OS_NAME=linux
TOXENV=py35
153.3
TRAVIS_PYTHON_VERSION=2.7.13
TRAVIS_OS_NAME=linux
TOXENV=py27

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading