def __new__(cls, *psources):
		psources = strip_null_sources(psources)
		if len(psources) == 1:
			return psources[0]
		elif not psources:
			return NullParameterSource()
		return ParameterSource.__new__(cls)
Example #2
0
 def __new__(cls, *psources):
     psources = strip_null_sources(psources)
     if len(psources) == 1:
         return psources[0]
     elif not psources:
         return NullParameterSource()
     return ParameterSource.__new__(cls)
Example #3
0
	def __new__(cls, *psrc_list):
		(repeat, psrc_list) = _separate_repeat(_strip_null_sources(psrc_list))
		if repeat != 1:
			return RepeatParameterSource(cls(*psrc_list), repeat)
		elif not psrc_list:
			return NullParameterSource()
		elif len(psrc_list) == 1:
			return psrc_list[0]
		return ParameterSource.__new__(cls)
Example #4
0
 def __new__(cls, *psrc_list):
     (repeat, psrc_list) = _separate_repeat(_strip_null_sources(psrc_list))
     if repeat != 1:
         return RepeatParameterSource(cls(*psrc_list), repeat)
     elif not psrc_list:
         return NullParameterSource()
     elif len(psrc_list) == 1:
         return psrc_list[0]
     return ParameterSource.__new__(cls)
Example #5
0
	def __new__(cls, psrc, times):  # pylint:disable=arguments-differ
		if times < 0:
			return psrc
		elif psrc.get_parameter_len() is None:
			return TruncateParameterSource(psrc, times)
		elif times == 0:
			return NullParameterSource()
		elif times == 1:
			return psrc
		return ParameterSource.__new__(cls)
Example #6
0
 def __new__(cls, psrc, times):  # pylint:disable=arguments-differ
     if times < 0:
         return psrc
     elif psrc.get_parameter_len() is None:
         return TruncateParameterSource(psrc, times)
     elif times == 0:
         return NullParameterSource()
     elif times == 1:
         return psrc
     return ParameterSource.__new__(cls)
Example #7
0
	def __new__(cls, *args):  # pylint:disable=arguments-differ
		return ParameterSource.__new__(cls)
Example #8
0
	def __new__(cls, psrc, max_len):  # pylint:disable=arguments-differ
		if max_len == 0:
			return NullParameterSource()
		elif max_len < 0:
			return psrc
		return ParameterSource.__new__(cls)
Example #9
0
 def __new__(cls, *args):  # pylint:disable=arguments-differ
     return ParameterSource.__new__(cls)
Example #10
0
 def __new__(cls, psrc, max_len):  # pylint:disable=arguments-differ
     if max_len == 0:
         return NullParameterSource()
     elif max_len < 0:
         return psrc
     return ParameterSource.__new__(cls)