Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
ea8f09c3
Commit
ea8f09c3
authored
Apr 04, 2014
by
Stavros Sachtouris
Browse files
Make OutputFormatArgument.value a variable
The object was a property, although this served no purpose at all.
parent
998d7e25
Changes
1
Show whitespace changes
Inline
Side-by-side
kamaki/cli/cmds/__init__.py
View file @
ea8f09c3
...
...
@@ -285,21 +285,16 @@ class OutputFormatArgument(ValueArgument):
def
___init__
(
self
,
*
args
,
**
kwargs
):
super
(
OutputFormatArgument
,
self
).
___init__
(
*
args
,
**
kwargs
)
self
.
value
=
None
@
property
def
value
(
self
):
return
getattr
(
self
,
'_value'
,
None
)
@
value
.
setter
def
value
(
self
,
newvalue
):
if
not
newvalue
:
return
elif
newvalue
.
lower
()
in
self
.
formats
:
self
.
_
value
=
newvalue
.
lower
()
self
.
value
=
newvalue
.
lower
()
else
:
raise
CLIInvalidArgument
(
'Invalid value %s for argument %s'
%
(
newvalue
,
self
.
lvalue
),
'Invalid value %s for argument %s'
%
(
newvalue
,
self
.
lvalue
),
details
=
[
'Valid output formats: %s'
%
', '
.
join
(
self
.
formats
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment