예제 #1
0
파일: dataitems.py 프로젝트: phil65/guidata
 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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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 )
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #19
0
 def __init__(self, text='', label='', default=None, help=''):
     DataItem.__init__(self, label, default=default, help=help)
     self.set_prop("display", text=text)