Commit c20b2ef2 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Set default value to Config.IGNORE_WEEKENDS.

No need to set this default by the Sorter. A dependency less on
Config.
parent 169ad56d
......@@ -37,7 +37,7 @@ def is_due_next_monday(p_todo):
return due and due.weekday() == 0 and today.weekday() >= 4 and \
p_todo.days_till_due()
def importance(p_todo, p_ignore_weekend=False):
def importance(p_todo, p_ignore_weekend=Config.IGNORE_WEEKENDS):
"""
Calculates the importance of the given task.
Returns an importance of zero when the task has been completed.
......@@ -74,7 +74,7 @@ def importance(p_todo, p_ignore_weekend=False):
return result if not p_todo.is_completed() else 0
def average_importance(p_todo, p_ignore_weekend=False):
def average_importance(p_todo, p_ignore_weekend=Config.IGNORE_WEEKENDS):
own_importance = importance(p_todo, p_ignore_weekend)
average = 0
......
......@@ -19,7 +19,6 @@
from datetime import date
import re
import Config
from Importance import importance, average_importance
def is_priority_field(p_field):
......@@ -45,9 +44,9 @@ def get_field_function(p_field):
result = (lambda a: a.completion_date() if a.completion_date() \
else date.max)
elif p_field == 'importance':
result = lambda a: importance(a, Config.IGNORE_WEEKENDS)
result = lambda a: importance(a)
elif p_field == 'importance-avg' or p_field == 'importance-average':
result = lambda a: average_importance(a, Config.IGNORE_WEEKENDS)
result = lambda a: average_importance(a)
elif p_field == 'text':
result = lambda a: a.text()
else:
......
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