def __init__(self, name, function): self.name = name if isinstance(function, basestring): self.function = conv.class_converter(function) else: self.function = function self.value = None
def __init__( self, name, default=None, doc=None, from_string_converter=None, value=None, short_form=None, exclude_from_print_conf=False, exclude_from_dump_conf=False, is_argument=False, comment_out=False, not_for_definition=False, ): self.name = name self.short_form = short_form self.default = default self.doc = doc if from_string_converter is None: if default is not None: # take a qualified guess from the default value from_string_converter = self._deduce_converter(default) if isinstance(from_string_converter, basestring): from_string_converter = conv.class_converter(from_string_converter) self.from_string_converter = from_string_converter if value is None: value = default self.value = value self.is_argument = is_argument self.exclude_from_print_conf = exclude_from_print_conf self.exclude_from_dump_conf = exclude_from_dump_conf self.comment_out = comment_out self.not_for_definition = not_for_definition
def __init__(self, name, default=None, doc=None, from_string_converter=None, value=None, short_form=None, *args, **kwargs): self.name = name self.short_form = short_form self.default = default self.doc = doc if from_string_converter is None: if default is not None: # take a qualified guess from the default value from_string_converter = self._deduce_converter(default) if isinstance(from_string_converter, basestring): from_string_converter = conv.class_converter(from_string_converter) self.from_string_converter = from_string_converter if value is None: value = default self.set_value(value) if (type(self.value) != type(self.default) and self.from_string_converter): # need to convert the default too self.default = self.from_string_converter(self.default)
def __init__(self, name, default=None, doc=None, from_string_converter=None, value=None, short_form=None, exclude_from_print_conf=False, exclude_from_dump_conf=False, is_argument=False, comment_out=False, not_for_definition=False, ): self.name = name self.short_form = short_form self.default = default self.doc = doc if from_string_converter is None: if default is not None: # take a qualified guess from the default value from_string_converter = self._deduce_converter(default) if isinstance(from_string_converter, basestring): from_string_converter = conv.class_converter(from_string_converter) self.from_string_converter = from_string_converter if value is None: value = default self.value = value self.is_argument = is_argument self.exclude_from_print_conf = exclude_from_print_conf self.exclude_from_dump_conf = exclude_from_dump_conf self.comment_out = comment_out self.not_for_definition = not_for_definition
def __init__( self, name, default=None, doc=None, from_string_converter=None, value=None, short_form=None, exclude_from_print_conf=False, exclude_from_dump_conf=False, ): self.name = name self.short_form = short_form self.default = default self.doc = doc if from_string_converter is None: if default is not None: # take a qualified guess from the default value from_string_converter = self._deduce_converter(default) if isinstance(from_string_converter, basestring): from_string_converter = conv.class_converter(from_string_converter) self.from_string_converter = from_string_converter if value is None: value = default self.set_value(value) if (type(self.value) != type(self.default) and self.from_string_converter): # need to convert the default too self.default = self.from_string_converter(self.default) self.exclude_from_print_conf = exclude_from_print_conf self.exclude_from_dump_conf = exclude_from_dump_conf
def __init__( self, name, default=None, doc=None, from_string_converter=None, to_string_converter=None, value=None, short_form=None, exclude_from_print_conf=False, exclude_from_dump_conf=False, is_argument=False, likely_to_be_changed=False, not_for_definition=False, reference_value_from=None, ): self.name = name self.short_form = short_form self.default = default self.doc = doc if from_string_converter is None: if default is not None: # take a qualified guess from the default value from_string_converter = self._deduce_converter(default) if isinstance(from_string_converter, basestring): from_string_converter = conv.class_converter(from_string_converter) self.from_string_converter = from_string_converter # if this is not set, the type is used in converters.py to attempt # the conversion self.to_string_converter = to_string_converter if value is None: value = default self.value = value self.is_argument = is_argument self.exclude_from_print_conf = exclude_from_print_conf self.exclude_from_dump_conf = exclude_from_dump_conf self.likely_to_be_changed = likely_to_be_changed self.not_for_definition = not_for_definition self.reference_value_from = reference_value_from