Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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 )
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
 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)
Example #12
0
 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)
Example #13
0
 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)
Example #14
0
 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)
Example #15
0
 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)
Example #16
0
 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)
Example #17
0
 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)
Example #18
0
 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)
Example #19
0
 def __init__(self, text='', label='', default=None, help=''):
     DataItem.__init__(self, label, default=default, help=help)
     self.set_prop("display", text=text)