Commit 3f7c7fda authored by MinchinWeb's avatar MinchinWeb

Fix PEP257 D202 (selected)

No blank lines allowed after function docstring
parent 4204a657
......@@ -126,7 +126,6 @@ class DepCommandTest(CommandTest):
Helper function that checks the removal of the dependency from todo 1
to todo 3.
"""
command = DepCommand(p_args, self.todolist, self.out, self.error)
command.execute()
......
......@@ -110,14 +110,12 @@ class TodoBaseTester(TopydoTest):
def test_tag_empty_value(self):
""" Tag should not be recorded when there is no value. """
todo = TodoBase("(C) Foo foo:")
self.assertFalse(todo.has_tag('foo'))
def test_tag_empty_key(self):
""" Tag should not be recorded when there is no key. """
todo = TodoBase("(C) Foo :bar")
self.assertFalse(todo.has_tag(''))
......
......@@ -216,13 +216,11 @@ class TodoListTester(TopydoTest):
"""
Must be able to handle integers when text identifiers are enabled.
"""
config("test/data/todolist-uid.conf")
self.assertRaises(InvalidTodoException, self.todolist.todo, 1)
def test_new_uid(self):
""" Make sure that item has new text ID after append. """
config("test/data/todolist-uid.conf")
todo = self.todolist.todo('t5c')
self.todolist.append(todo, "A")
......@@ -282,7 +280,6 @@ class TodoListDependencyTester(TopydoTest):
Make sure that previous add_dependency invocation stored the
edge_id properly.
"""
todo1 = self.todolist.todo(1)
todo4 = self.todolist.todo(4)
todo5 = self.todolist.todo(5)
......@@ -297,7 +294,6 @@ class TodoListDependencyTester(TopydoTest):
"""
Test that projects are not added double.
"""
todo6 = self.todolist.todo(6)
todo7 = self.todolist.todo(7)
projects = todo7.projects().copy()
......
......@@ -78,7 +78,6 @@ def write(p_file, p_string):
def error(p_string):
""" Writes an error on the standard error. """
write(sys.stderr, p_string)
......
......@@ -72,7 +72,6 @@ class PromptApplication(CLIApplicationBase):
If the modification time of the todo.txt file is equal to the last time
it was checked, nothing will be done.
"""
current_mtime = _todotxt_mtime()
if not self.todofile or self.mtime != current_mtime:
......
......@@ -75,7 +75,6 @@ class ListCommand(ExpressionCommand):
printing). If a format was specified on the commandline, this format is
sent to the output.
"""
if self.printer is None:
# create a standard printer with some filters
indent = config().list_indent()
......
......@@ -26,7 +26,6 @@ class Filter(object):
Filters a list of todos. Truncates the list after p_limit todo
items (or no maximum limit if omitted).
"""
return [t for t in p_todos if self.match(t)]
def match(self, _):
......
......@@ -98,6 +98,7 @@ class IcalPrinter(Printer):
Gets a unique ID from a todo item, stored by the ical tag. If the
tag is not present, a random value is assigned to it and returned.
"""
def generate_uid(p_length=4):
"""
Generates a random string of the given length, used as
......
......@@ -73,7 +73,6 @@ class PrettyPrinter(Printer):
def pretty_printer_factory(p_todolist, p_additional_filters=None):
""" Returns a pretty printer suitable for the ls and dep subcommands. """
p_additional_filters = p_additional_filters or []
printer = PrettyPrinter()
......
......@@ -47,7 +47,6 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
def filter(self, p_todo_str, p_todo):
""" Applies the colors. """
colorscheme = Colors()
priority_colors = colorscheme.get_priority_colors()
project_color = colorscheme.get_project_color()
......
......@@ -95,7 +95,6 @@ def relative_date_to_date(p_date, p_offset=None):
* 'today' or 'tomorrow'
* days of the week (in full or abbreviated)
"""
result = None
p_date = p_date.lower()
p_offset = p_offset or date.today()
......
......@@ -101,7 +101,6 @@ class Sorter(object):
sort operation is done first, relying on the stability of the sorted()
function.
"""
sorted_todos = p_todos
for function, order in reversed(self.functions):
sorted_todos = sorted(sorted_todos, key=function,
......
......@@ -58,7 +58,6 @@ class TodoBase(object):
Returns a list of all tag values associated with p_key. Returns
empty list if p_key does not exist.
"""
tags = self.fields['tags']
matches = [tag[1] for tag in tags if tag[0] == p_key]
return matches if len(matches) else []
......@@ -69,7 +68,6 @@ class TodoBase(object):
value is passed, it will only return true when there exists a tag with
the given key-value combination.
"""
result = [t for t in self.tag_values(p_key)
if p_value == "" or t == p_value]
return len(result) > 0
......@@ -92,7 +90,6 @@ class TodoBase(object):
When p_old_value is set, all tags having this value will be set to the
new value.
"""
if p_value == "":
self.remove_tag(p_key, p_old_value)
return
......@@ -146,7 +143,6 @@ class TodoBase(object):
Priority remains unchanged when an invalid priority is given, or when
the task was completed.
"""
if not self.is_completed() and (p_priority is None or
is_valid_priority(p_priority)):
self.fields['priority'] = p_priority
......
......@@ -49,7 +49,6 @@ class TodoFile(object):
p_todos can be a list of todo items, or a string that is just written
to the file.
"""
todofile = codecs.open(self.path, 'w', encoding="utf-8")
if p_todos is list:
......
......@@ -58,7 +58,6 @@ class TodoList(TodoListBase):
Makes sure that the dependency graph is consistent according to the
given todo.
"""
dep_id = p_todo.tag_value('id')
# maintain dependency graph
if dep_id:
......@@ -226,6 +225,5 @@ class TodoList(TodoListBase):
This is used for calculating the average importance, that requires
access to a todo's parents.
"""
for todo in self._todos:
todo.attributes['parents'] = self.parents(todo)
......@@ -89,7 +89,6 @@ class TodoListBase(object):
When the identifier is a number but has leading zeros, the result
will be None.
"""
result = None
if config().identifiers() != 'text':
......
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