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