def __init__(self, label, formats='*', default=None, basedir=None, all_files_first=False, help='', check=True): DataItem.__init__(self, label, default=default, help=help, check=check) if isinstance(formats, str): formats = [formats] self.set_prop("data", formats=formats) self.set_prop("data", basedir=basedir) self.set_prop("data", all_files_first=all_files_first)
def __init__(self, label, default=None, notempty=None, wordwrap=False, help=""): DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", notempty=notempty) self.set_prop("display", wordwrap=wordwrap)
def __init__(self, label, callback, icon=None, default=None, help="", check=True): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", callback=callback) self.set_prop("display", icon=icon)
def __init__(self, label, default=None, min=None, max=None, nonzero=None, unit='', help=''): DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", min=min, max=max, nonzero=nonzero) self.set_prop("display", unit=unit)
def __init__(self, label, default=None, help='', format='%.3f', transpose=False, minmax="all"): DataItem.__init__(self, label, default=default, help=help) self.set_prop("display", format=format, transpose=transpose, minmax=minmax)
def __init__(self, label, choices, default=FirstChoice, help=''): if isinstance(choices, collections.Callable): _choices_data = ItemProperty(choices) else: _choices_data = [] for idx, choice in enumerate(choices): _choices_data.append(self._normalize_choice(idx, choice)) if default is FirstChoice and\ not isinstance(choices, collections.Callable): default = _choices_data[0][0] elif default is FirstChoice: default = None DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", choices=_choices_data)
def __init__(self, label, choices, default=FirstChoice, help=''): if isinstance(choices, collections.Callable): _choices_data = ItemProperty(choices) else: _choices_data = [] for idx, choice in enumerate(choices): _choices_data.append( self._normalize_choice(idx, choice) ) if default is FirstChoice and\ not isinstance(choices, collections.Callable): default = _choices_data[0][0] elif default is FirstChoice: default = None DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", choices=_choices_data )
def __init__( self, label, default=None, help="", format="%.3f", transpose=False, minmax="all", check=True, ): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", format=format, transpose=transpose, minmax=minmax)
def __init__( self, label, default=None, min=None, max=None, nonzero=None, unit="", help="", check=True, ): DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", min=min, max=max, nonzero=nonzero, check_value=check) self.set_prop("display", unit=unit)
def get_string_value(self, instance): """Override DataItem method""" value = self.get_value(instance) choices = self.get_prop_value("data", instance, "choices") # print "ShowChoiceWidget:", choices, value for choice in choices: if choice[0] == value: return to_text_string(choice[1]) else: return DataItem.get_string_value(self, instance)
def get_string_value(self, instance): """Override DataItem method""" value = self.get_value(instance) choices = self.get_prop_value("data", instance, "choices") #print "ShowChoiceWidget:", choices, value for choice in choices: if choice[0] == value: return to_text_string(choice[1]) else: return DataItem.get_string_value(self, instance)
def __init__(self, text="", label="", default=None, help="", check=True): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", text=text)
def __init__(self, label, callback, icon=None, default=None, help='', check=True): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", callback=callback) self.set_prop("display", icon=icon)
def __init__(self, label, default=None, help='', format='%.3f', transpose=False, minmax="all", check=True): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", format=format, transpose=transpose, minmax=minmax)
def __init__(self, text='', label='', default=None, help='', check=True): DataItem.__init__(self, label, default=default, help=help, check=check) self.set_prop("display", text=text)
def __init__(self, label, default=None, notempty=None, wordwrap=False, help=''): DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", notempty=notempty) self.set_prop("display", wordwrap=wordwrap)
def __init__(self, label, default=None, min=None, max=None, nonzero=None, unit='', help='', check=True): DataItem.__init__(self, label, default=default, help=help) self.set_prop("data", min=min, max=max, nonzero=nonzero, check_value=check) self.set_prop("display", unit=unit)
def __init__(self, text='', label='', default=None, help=''): DataItem.__init__(self, label, default=default, help=help) self.set_prop("display", text=text)