Commit ea8f09c3 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Make OutputFormatArgument.value a variable

The object was a property, although this served no purpose at all.
parent 998d7e25
...@@ -285,21 +285,16 @@ class OutputFormatArgument(ValueArgument): ...@@ -285,21 +285,16 @@ class OutputFormatArgument(ValueArgument):
def ___init__(self, *args, **kwargs): def ___init__(self, *args, **kwargs):
super(OutputFormatArgument, self).___init__(*args, **kwargs) super(OutputFormatArgument, self).___init__(*args, **kwargs)
self.value = None
def value(self):
return getattr(self, '_value', None)
def value(self, newvalue): def value(self, newvalue):
if not newvalue: if not newvalue:
return return
elif newvalue.lower() in self.formats: elif newvalue.lower() in self.formats:
self._value = newvalue.lower() self.value = newvalue.lower()
else: else:
raise CLIInvalidArgument( raise CLIInvalidArgument(
'Invalid value %s for argument %s' % ( 'Invalid value %s for argument %s' % (newvalue, self.lvalue),
newvalue, self.lvalue),
details=['Valid output formats: %s' % ', '.join(self.formats)]) details=['Valid output formats: %s' % ', '.join(self.formats)])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment