mirror of https://github.com/snachodog/mybuddy.git
Fix minor linting issues.
This commit is contained in:
parent
a47767355d
commit
efc613c637
|
@ -43,7 +43,7 @@
|
||||||
| | | | | | | | | | | (_) | |
|
| | | | | | | | | | | (_) | |
|
||||||
| '--------------' | '--------------' | '--------------' | '--------------' |
|
| '--------------' | '--------------' | '--------------' | '--------------' |
|
||||||
'----------------' '----------------' '----------------' '----------------'
|
'----------------' '----------------' '----------------' '----------------'
|
||||||
"""
|
""" # noqa
|
||||||
|
|
||||||
__title__ = 'Baby Buddy'
|
__title__ = 'Baby Buddy'
|
||||||
__version__ = '1.2.0'
|
__version__ = '1.2.0'
|
||||||
|
|
|
@ -119,7 +119,7 @@ class Command(BaseCommand):
|
||||||
"""
|
"""
|
||||||
method = choice(models.Feeding._meta.get_field('method').choices)[0]
|
method = choice(models.Feeding._meta.get_field('method').choices)[0]
|
||||||
amount = None
|
amount = None
|
||||||
if method is 'bottle':
|
if method == 'bottle':
|
||||||
amount = Decimal('%d.%d' % (randint(0, 6), randint(0, 9)))
|
amount = Decimal('%d.%d' % (randint(0, 6), randint(0, 9)))
|
||||||
start = self.time + timedelta(minutes=randint(1, 60))
|
start = self.time + timedelta(minutes=randint(1, 60))
|
||||||
end = start + timedelta(minutes=randint(5, 20))
|
end = start + timedelta(minutes=randint(5, 20))
|
||||||
|
|
|
@ -14,10 +14,10 @@ def duration_string(duration, precision='s'):
|
||||||
duration = '{} hour{}'.format(h, 's' if h > 1 else '')
|
duration = '{} hour{}'.format(h, 's' if h > 1 else '')
|
||||||
if m > 0 and precision != 'h':
|
if m > 0 and precision != 'h':
|
||||||
duration += '{}{} minute{}'.format(
|
duration += '{}{} minute{}'.format(
|
||||||
'' if duration is '' else ', ', m, 's' if m > 1 else '')
|
'' if duration == '' else ', ', m, 's' if m > 1 else '')
|
||||||
if s > 0 and precision != 'h' and precision != 'm':
|
if s > 0 and precision != 'h' and precision != 'm':
|
||||||
duration += '{}{} second{}'.format(
|
duration += '{}{} second{}'.format(
|
||||||
'' if duration is '' else ', ', s, 's' if s > 1 else '')
|
'' if duration == '' else ', ', s, 's' if s > 1 else '')
|
||||||
|
|
||||||
return duration
|
return duration
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue