Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/hab_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
from dates import parse_date_utc
from task import CharacterAttribute, ChecklistItem, Difficulty, Task

class HabTask(object):

class HabTask():

Check warning

Code scanning / Prospector (reported by Codacy)

Too many public methods (22/20) (too-many-public-methods) Warning

Too many public methods (22/20) (too-many-public-methods)
"""Class to hold data for a single Habitica task """
def __init__(self, task_dict=None):
""" Initialise the task.
Expand Down Expand Up @@ -74,8 +76,8 @@
return ''

@property
#When did the daily start running? (That is, is it active now?)
def starting(self):
"""When did the daily start running? (That is, is it active now?)"""
from dateutil import parser
import datetime
if self.__task_dict['type'] == 'daily':
Expand Down
12 changes: 6 additions & 6 deletions source/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,16 @@ def sync_hab2todo_todo(hab, tod):
habDict['priority'] = 1

try:
dueNow = tod.due.date()
due_now = tod.due.date()
except:
dueNow = ''
due_now = ''
try:
dueOld = parse_date_utc(hab.date).date()
due_old = parse_date_utc(hab.date).date()
except:
dueOld = ''
due_old = ''

if dueOld != dueNow:
habDict['date'] = str(dueNow)
if due_old != due_now:
habDict['date'] = str(due_now)

new_hab = HabTask(habDict)
return new_hab
Expand Down
Loading