Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def traits_view(self):
commit_grp = VGroup(Item('ncommits', label='Limit'),
VGroup(UItem('commits',
editor=TabularEditor(adapter=CommitAdapter(),
selected='selected_commit')),
show_border=True, label='Commits'))
bookmark_grp = VGroup(VGroup(UItem('git_tags', editor=TabularEditor(adapter=GitTagAdapter()),
height=200),
show_border=True, label='Bookmarks'))
v = View(VGroup(UItem('branch',
editor=EnumEditor(name='branches')),
VSplit(commit_grp, bookmark_grp)))
return v
),
Item('case_sensitive')
),
VSplit(
VGroup(
Item('summary',
editor=TitleEditor()
),
Item('source_files',
id='source_files',
editor=table_editor
),
dock='horizontal',
show_labels=False
),
VGroup(
HGroup(
Item('selected_full_name',
editor=TitleEditor(),
springy=True
),
Item('selected_full_name',
editor=DNDEditor(),
tooltip='Drag this file'
),
show_labels=False
),
Item('selected_contents',
style='readonly',
editor=CodeEditor(mark_lines='mark_lines',
line='selected_line',
selected_line='selected_line')
callee_map = Dict()
# Map from the (file, lineno, name) tuple to the record.
record_map = Dict()
#### GUI traits ############################################################
basenames = Bool(True)
percentages = Bool(True)
filename = Str()
line = Int(1)
code = Str()
traits_view = tui.View(
tui.VGroup(
tui.HGroup(
tui.Item('basenames'),
tui.Item('percentages'),
),
tui.HGroup(
tui.UItem('main_results'),
tui.VGroup(
tui.Label('Callees'),
tui.UItem('callee_results'),
tui.Label('Callers'),
tui.UItem('caller_results'),
tui.UItem('filename', style='readonly'),
tui.UItem('code', editor=tui.CodeEditor(line='line')),
),
style='custom',
),
Item('streamline_param', label="DTB_streamline Parameters"),
show_border = True,
visible_when = "diffusion_imaging_model == 'DSI' or diffusion_imaging_model == 'QBALL'",
),
VGroup(
Item('streamline_param', label="DTB_streamline Parameters"),
show_border = True,
visible_when = "diffusion_imaging_model == 'DTI'"
),
enabled_when = "active_tractography",
visible_when = "active_tractography",
label = "Tractography",
)
fiberfilter_group = Group(
VGroup(
Item('apply_splinefilter', label="Apply spline filter"),
Item('apply_fiberlength', label="Apply cutoff filter"),
Item('fiber_cutoff_lower', label='Lower cutoff length (mm)', enabled_when = 'apply_fiberlength'),
Item('fiber_cutoff_upper', label='Upper cutoff length (mm)', enabled_when = 'apply_fiberlength'),
show_border = True,
enabled_when = "active_fiberfilter"
),
visible_when = "active_fiberfilter",
label = "Fiber Filtering",
)
applyregistration_group = Group(
VGroup(
Item('parcellation_scheme', label="Used Parcellation Scheme"),
show_border = True,
enabled_when = "active_applyregistration"
return View(VGroup(Item('controls_list',
editor = VerticalListEditor(editor = InstanceEditor(view = self.control_traits_view()),
style = 'custom',
mutable = False),
style = 'custom'),
Item('handler.add_control',
editor = ButtonEditor(value = True,
label = "Add a control")),
Item('handler.remove_control',
editor = ButtonEditor(value = True,
label = "Remove a control")),
label = "Controls",
show_labels = False),
Item('mixture_model',
label = "Use mixture\nmodel?"),
VGroup(Item('subset_list',
show_label = False,
editor = SubsetListEditor(conditions = "context.previous_wi.conditions",
metadata = "context.previous_wi.metadata",
when = "'experiment' not in vars() or not experiment")),
label = "Subset",
show_border = False,
show_labels = False),
Item('do_estimate',
editor = ButtonEditor(value = True,
label = "Estimate!"),
show_label = False),
shared_op_traits)
def traits_view(self):
# style_sheet='QLabel {font-size: 10px} QLineEdit {font-size: 10px}'
a = VGroup(UItem('value'),
UItem('error_message', style='readonly', style_sheet=STYLESHEET))
buttons = [OKButton(), 'Cancel']
return self._new_view(a,
width=400,
title='Add {}'.format(self.tag),
buttons=buttons)
def _define_task_view(self):
"""
"""
line_completer = LineCompleterEditor(
entries_updater = self._list_database_entries)
view = View(
VGroup(
UItem('task_name', style = 'readonly'),
Group(
Label('Array'), Label('Column name'),
Label('Mode'),
UItem('target_array', editor = line_completer),
UItem('column_name'),
UItem('mode'),
columns = 3,
show_border = True,
),
),
)
self.trait_view('task_view', view)
def traits_view(self):
required_grp = VGroup(Item('sample_type', label='Sample Type'),
Item('name', label='Name'),
Item('material', label='Material'),
label='Required', show_border=True)
collection_grp = VGroup(Item('collector', label='Collection'),
Item('collection_method', label='Collection Method'),
HGroup(Item('_collection_start_date', label='Collection Start Date'),
UItem('_collection_start_time'),
UItem('timezone')),
label='Collection')
location_grp = VGroup(Item('latitude', label='Latitude', tooltip=LAT_TT),
Item('longitude', label='Longitude', tooltip=LONG_TT),
Item('elevation', label='Elevation', tooltip=ELEVATION_TT),
Item('primary_location_name', label='Primary Location Name'),
Item('country', label='Country'),
Item('province', label='State/Province'),
def current_state_view(self):
g = VGroup(Item('graph', show_label=False, style='custom'),
VGroup(Item('scan_func', label='Function', style='readonly'),
HGroup(Item('scan_period', label='Period ({})'.format(self.scan_units)), spring),
Item('current_scan_value', style='readonly')),
VGroup(
HGroup(Item('scan_button', editor=ButtonEditor(label_value='scan_label'),
show_label=False),
spring),
Item('scan_root',
style='readonly',
label='Scan directory',
visible_when='object.record_scan_data'),
Item('scan_name', label='Scan name',
style='readonly',
visible_when='object.record_scan_data'),
visible_when='object.is_scanable'),
def traits_view(self):
v = View(VGroup(
HGroup(spring, CustomLabel('name', color='maroon', size=16,
height=-25,
width=100,
), spring),
Item('container', show_label=False, editor=ComponentEditor()),
))
return v