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
2af87afc
Commit
2af87afc
authored
Jul 19, 2013
by
Stavros Sachtouris
Browse files
Recover default fallback for Int/DateArguments
parent
b7ff6e0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/argument/__init__.py
View file @
2af87afc
...
...
@@ -223,7 +223,8 @@ class IntArgument(ValueArgument):
@
value
.
setter
def
value
(
self
,
newvalue
):
try
:
self
.
_value
=
int
(
newvalue
)
self
.
_value
=
self
.
default
if
(
newvalue
==
self
.
default
)
else
int
(
newvalue
)
except
ValueError
:
raiseCLIError
(
CLISyntaxError
(
'IntArgument Error'
,
...
...
@@ -252,7 +253,7 @@ class DateArgument(ValueArgument):
@
value
.
setter
def
value
(
self
,
newvalue
):
self
.
_value
=
self
.
format_date
(
newvalue
)
self
.
_value
=
self
.
format_date
(
newvalue
)
if
newvalue
else
self
.
default
def
format_date
(
self
,
datestr
):
for
format
in
self
.
INPUT_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