Commit 19b5623a authored by Bram Schoenmakers's avatar Bram Schoenmakers

Call super() without parameters now we support Python 3 only

parent 2578521a
...@@ -20,7 +20,7 @@ from topydo.lib.Utils import escape_ansi ...@@ -20,7 +20,7 @@ from topydo.lib.Utils import escape_ansi
class CommandTest(TopydoTest): class CommandTest(TopydoTest):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(CommandTest, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.output = "" self.output = ""
self.errors = "" self.errors = ""
......
...@@ -33,7 +33,7 @@ except ImportError: ...@@ -33,7 +33,7 @@ except ImportError:
class AddCommandTest(CommandTest): class AddCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(AddCommandTest, self).setUp() super().setUp()
self.todolist = TodoList.TodoList([]) self.todolist = TodoList.TodoList([])
self.today = date.today().isoformat() self.today = date.today().isoformat()
......
...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList ...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList
class AppendCommandTest(CommandTest): class AppendCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(AppendCommandTest, self).setUp() super().setUp()
self.todolist = TodoList([]) self.todolist = TodoList([])
self.todolist.add("Foo") self.todolist.add("Foo")
......
...@@ -33,7 +33,7 @@ def _no_prompt(self): ...@@ -33,7 +33,7 @@ def _no_prompt(self):
class DeleteCommandTest(CommandTest): class DeleteCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(DeleteCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList ...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList
class DepCommandTest(CommandTest): class DepCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(DepCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList ...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList
class DepriCommandTest(CommandTest): class DepriCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(DepriCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"(A) Foo", "(A) Foo",
"Bar", "Bar",
......
...@@ -32,7 +32,7 @@ def _no_prompt(self): ...@@ -32,7 +32,7 @@ def _no_prompt(self):
class DoCommandTest(CommandTest): class DoCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(DoCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1", "Bar p:1",
......
...@@ -33,7 +33,7 @@ except ImportError: ...@@ -33,7 +33,7 @@ except ImportError:
class EditCommandTest(CommandTest): class EditCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(EditCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo id:1", "Foo id:1",
"Bar p:1 @test", "Bar p:1 @test",
......
...@@ -301,7 +301,7 @@ class FilterTest(TopydoTest): ...@@ -301,7 +301,7 @@ class FilterTest(TopydoTest):
class OrdinalTagFilterTest(TopydoTest): class OrdinalTagFilterTest(TopydoTest):
def setUp(self): def setUp(self):
super(OrdinalTagFilterTest, self).setUp() super().setUp()
today = date.today() today = date.today()
tomorrow = today + timedelta(1) tomorrow = today + timedelta(1)
...@@ -381,7 +381,7 @@ class OrdinalTagFilterTest(TopydoTest): ...@@ -381,7 +381,7 @@ class OrdinalTagFilterTest(TopydoTest):
class CreationFilterTest(TopydoTest): class CreationFilterTest(TopydoTest):
def setUp(self): def setUp(self):
super(CreationFilterTest, self).setUp() super().setUp()
self.todo1 = "2015-12-19 With creation date." self.todo1 = "2015-12-19 With creation date."
self.todo2 = "Without creation date." self.todo2 = "Without creation date."
...@@ -415,7 +415,7 @@ class CreationFilterTest(TopydoTest): ...@@ -415,7 +415,7 @@ class CreationFilterTest(TopydoTest):
class CompletionFilterTest(TopydoTest): class CompletionFilterTest(TopydoTest):
def setUp(self): def setUp(self):
super(CompletionFilterTest, self).setUp() super().setUp()
self.todo1 = "2015-12-19 With creation date." self.todo1 = "2015-12-19 With creation date."
self.todo2 = "x 2015-12-19 2015-12-18 Without creation date." self.todo2 = "x 2015-12-19 2015-12-18 Without creation date."
...@@ -459,7 +459,7 @@ class CompletionFilterTest(TopydoTest): ...@@ -459,7 +459,7 @@ class CompletionFilterTest(TopydoTest):
class PriorityFilterTest(TopydoTest): class PriorityFilterTest(TopydoTest):
def setUp(self): def setUp(self):
super(PriorityFilterTest, self).setUp() super().setUp()
self.todo1 = "(A) Foo" self.todo1 = "(A) Foo"
self.todo2 = "(B) Bar" self.todo2 = "(B) Bar"
......
...@@ -22,7 +22,7 @@ from topydo.lib.Graph import DirectedGraph ...@@ -22,7 +22,7 @@ from topydo.lib.Graph import DirectedGraph
class GraphTest(TopydoTest): class GraphTest(TopydoTest):
def setUp(self): def setUp(self):
super(GraphTest, self).setUp() super().setUp()
self.graph = DirectedGraph() self.graph = DirectedGraph()
......
...@@ -35,7 +35,7 @@ except ImportError: ...@@ -35,7 +35,7 @@ except ImportError:
class ListCommandTest(CommandTest): class ListCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(ListCommandTest, self).setUp() super().setUp()
self.todolist = load_file_to_todolist("test/data/ListCommandTest.txt") self.todolist = load_file_to_todolist("test/data/ListCommandTest.txt")
self.terminal_size = namedtuple('terminal_size', ['columns', 'lines']) self.terminal_size = namedtuple('terminal_size', ['columns', 'lines'])
...@@ -397,7 +397,7 @@ class ListCommandTest(CommandTest): ...@@ -397,7 +397,7 @@ class ListCommandTest(CommandTest):
class ListCommandUnicodeTest(CommandTest): class ListCommandUnicodeTest(CommandTest):
def setUp(self): def setUp(self):
super(ListCommandUnicodeTest, self).setUp() super().setUp()
self.todolist = load_file_to_todolist("test/data/ListCommandUnicodeTest.txt") self.todolist = load_file_to_todolist("test/data/ListCommandUnicodeTest.txt")
def test_list_unicode1(self): def test_list_unicode1(self):
......
...@@ -36,7 +36,7 @@ except ImportError: ...@@ -36,7 +36,7 @@ except ImportError:
@freeze_time("2015, 11, 06") @freeze_time("2015, 11, 06")
class ListFormatTest(CommandTest): class ListFormatTest(CommandTest):
def setUp(self): def setUp(self):
super(ListFormatTest, self).setUp() super().setUp()
self.todolist = load_file_to_todolist("test/data/ListFormat.txt") self.todolist = load_file_to_todolist("test/data/ListFormat.txt")
self.terminal_size = namedtuple('terminal_size', ['columns', 'lines']) self.terminal_size = namedtuple('terminal_size', ['columns', 'lines'])
......
...@@ -24,7 +24,7 @@ from topydo.lib.TodoList import TodoList ...@@ -24,7 +24,7 @@ from topydo.lib.TodoList import TodoList
class PostponeCommandTest(CommandTest): class PostponeCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(PostponeCommandTest, self).setUp() super().setUp()
self.today = date.today() self.today = date.today()
self.past = date.today() - timedelta(1) self.past = date.today() - timedelta(1)
self.future = date.today() + timedelta(1) self.future = date.today() + timedelta(1)
......
...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList ...@@ -23,7 +23,7 @@ from topydo.lib.TodoList import TodoList
class PriorityCommandTest(CommandTest): class PriorityCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(PriorityCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"(A) Foo", "(A) Foo",
"Bar", "Bar",
......
...@@ -25,7 +25,7 @@ from topydo.lib.Todo import Todo ...@@ -25,7 +25,7 @@ from topydo.lib.Todo import Todo
class RecurrenceTest(TopydoTest): class RecurrenceTest(TopydoTest):
def setUp(self): def setUp(self):
super(RecurrenceTest, self).setUp() super().setUp()
self.todo = Todo("Test rec:1w") self.todo = Todo("Test rec:1w")
self.stricttodo = Todo("Test rec:+1w") self.stricttodo = Todo("Test rec:+1w")
......
...@@ -25,7 +25,7 @@ from topydo.lib.RelativeDate import relative_date_to_date ...@@ -25,7 +25,7 @@ from topydo.lib.RelativeDate import relative_date_to_date
@freeze_time('2015, 11, 06') @freeze_time('2015, 11, 06')
class RelativeDateTester(TopydoTest): class RelativeDateTester(TopydoTest):
def setUp(self): def setUp(self):
super(RelativeDateTester, self).setUp() super().setUp()
self.yesterday = date(2015, 11, 5) self.yesterday = date(2015, 11, 5)
self.today = date(2015, 11, 6) self.today = date(2015, 11, 6)
self.tomorrow = date(2015, 11, 7) self.tomorrow = date(2015, 11, 7)
......
...@@ -35,7 +35,7 @@ from topydo.lib.TodoList import TodoList ...@@ -35,7 +35,7 @@ from topydo.lib.TodoList import TodoList
class RevertCommandTest(CommandTest): class RevertCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(RevertCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo", "Foo",
"Bar", "Bar",
......
...@@ -24,7 +24,7 @@ from topydo.lib.Config import config ...@@ -24,7 +24,7 @@ from topydo.lib.Config import config
class SortCommandTest(CommandTest): class SortCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(SortCommandTest, self).setUp() super().setUp()
self.todolist = load_file_to_todolist("test/data/SorterTest1.txt") self.todolist = load_file_to_todolist("test/data/SorterTest1.txt")
def test_sort1(self): def test_sort1(self):
......
...@@ -24,7 +24,7 @@ from topydo.lib.TodoList import TodoList ...@@ -24,7 +24,7 @@ from topydo.lib.TodoList import TodoList
class TagCommandTest(CommandTest): class TagCommandTest(CommandTest):
def setUp(self): def setUp(self):
super(TagCommandTest, self).setUp() super().setUp()
todos = [ todos = [
"Foo", "Foo",
"Bar due:2014-10-22", "Bar due:2014-10-22",
......
...@@ -29,7 +29,7 @@ from topydo.lib.TodoListBase import InvalidTodoException, TodoListBase ...@@ -29,7 +29,7 @@ from topydo.lib.TodoListBase import InvalidTodoException, TodoListBase
class TodoListTester(TopydoTest): class TodoListTester(TopydoTest):
def setUp(self): def setUp(self):
super(TodoListTester, self).setUp() super().setUp()
self.todofile = TodoFile('test/data/TodoListTest.txt') self.todofile = TodoFile('test/data/TodoListTest.txt')
lines = [line for line in self.todofile.read() lines = [line for line in self.todofile.read()
...@@ -230,7 +230,7 @@ class TodoListTester(TopydoTest): ...@@ -230,7 +230,7 @@ class TodoListTester(TopydoTest):
class TodoListDependencyTester(TopydoTest): class TodoListDependencyTester(TopydoTest):
def setUp(self): def setUp(self):
super(TodoListDependencyTester, self).setUp() super().setUp()
self.todolist = TodoList([]) self.todolist = TodoList([])
self.todolist.add("Foo id:1") self.todolist.add("Foo id:1")
...@@ -383,7 +383,7 @@ class TodoListCleanDependencyTester(TopydoTest): ...@@ -383,7 +383,7 @@ class TodoListCleanDependencyTester(TopydoTest):
""" """
def setUp(self): def setUp(self):
super(TodoListCleanDependencyTester, self).setUp() super().setUp()
self.todolist = TodoList([]) self.todolist = TodoList([])
def test_clean_dependencies1(self): def test_clean_dependencies1(self):
......
...@@ -41,7 +41,7 @@ class CLIApplication(CLIApplicationBase): ...@@ -41,7 +41,7 @@ class CLIApplication(CLIApplicationBase):
""" """
def __init__(self): def __init__(self):
super(CLIApplication, self).__init__() super().__init__()
def run(self): def run(self):
""" Main entry function. """ """ Main entry function. """
......
...@@ -59,7 +59,7 @@ class PromptApplication(CLIApplicationBase): ...@@ -59,7 +59,7 @@ class PromptApplication(CLIApplicationBase):
""" """
def __init__(self): def __init__(self):
super(PromptApplication, self).__init__() super().__init__()
self._process_flags() self._process_flags()
self.mtime = None self.mtime = None
......
...@@ -34,7 +34,7 @@ class AddCommand(Command): ...@@ -34,7 +34,7 @@ class AddCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(AddCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.text = ' '.join(p_args) self.text = ' '.join(p_args)
self.from_file = None self.from_file = None
...@@ -119,7 +119,7 @@ class AddCommand(Command): ...@@ -119,7 +119,7 @@ class AddCommand(Command):
def execute(self): def execute(self):
""" Adds a todo item to the list. """ """ Adds a todo item to the list. """
if not super(AddCommand, self).execute(): if not super().execute():
return False return False
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
......
...@@ -24,11 +24,11 @@ class AppendCommand(Command): ...@@ -24,11 +24,11 @@ class AppendCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(AppendCommand, self).__init__(p_args, p_todolist, p_out, p_err, super().__init__(p_args, p_todolist, p_out, p_err,
p_prompt) p_prompt)
def execute(self): def execute(self):
if not super(AppendCommand, self).execute(): if not super().execute():
return False return False
try: try:
......
...@@ -27,7 +27,7 @@ class ArchiveCommand(Command): ...@@ -27,7 +27,7 @@ class ArchiveCommand(Command):
TodoListBase class which does no dependency checking, so a better TodoListBase class which does no dependency checking, so a better
choice for huge done.txt files. choice for huge done.txt files.
""" """
super(ArchiveCommand, self).__init__([], p_todolist) super().__init__([], p_todolist)
self.archive = p_archive_list self.archive = p_archive_list
def execute(self): def execute(self):
......
...@@ -22,7 +22,7 @@ class DeleteCommand(DCommand): ...@@ -22,7 +22,7 @@ class DeleteCommand(DCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(DeleteCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def prompt_text(self): def prompt_text(self):
......
...@@ -28,7 +28,7 @@ class DepCommand(Command): ...@@ -28,7 +28,7 @@ class DepCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(DepCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
try: try:
...@@ -109,7 +109,7 @@ class DepCommand(Command): ...@@ -109,7 +109,7 @@ class DepCommand(Command):
self.error(self.usage()) self.error(self.usage())
def execute(self): def execute(self):
if not super(DepCommand, self).execute(): if not super().execute():
return False return False
dispatch = { dispatch = {
......
...@@ -23,7 +23,7 @@ class DepriCommand(MultiCommand): ...@@ -23,7 +23,7 @@ class DepriCommand(MultiCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(DepriCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def _execute_multi_specific(self): def _execute_multi_specific(self):
......
...@@ -33,17 +33,17 @@ class DoCommand(DCommand): ...@@ -33,17 +33,17 @@ class DoCommand(DCommand):
self.strict_recurrence = False self.strict_recurrence = False
self.completion_date = date.today() self.completion_date = date.today()
super(DoCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def get_flags(self): def get_flags(self):
""" Additional flags. """ """ Additional flags. """
opts, long_opts = super(DoCommand, self).get_flags() opts, long_opts = super().get_flags()
return ("d:s" + opts, ["date=", "strict"] + long_opts) return ("d:s" + opts, ["date=", "strict"] + long_opts)
def process_flag(self, p_opt, p_value): def process_flag(self, p_opt, p_value):
super(DoCommand, self).process_flag(p_opt, p_value) super().process_flag(p_opt, p_value)
if p_opt == "-s" or p_opt == "--strict": if p_opt == "-s" or p_opt == "--strict":
self.strict_recurrence = True self.strict_recurrence = True
......
...@@ -39,7 +39,7 @@ def _is_edited(p_orig_mtime, p_file): ...@@ -39,7 +39,7 @@ def _is_edited(p_orig_mtime, p_file):
class EditCommand(MultiCommand): class EditCommand(MultiCommand):
def __init__(self, p_args, p_todolist, p_output, p_error, p_input): def __init__(self, p_args, p_todolist, p_output, p_error, p_input):
super(EditCommand, self).__init__(p_args, p_todolist, p_output, super().__init__(p_args, p_todolist, p_output,
p_error, p_input) p_error, p_input)
if len(self.args) == 0: if len(self.args) == 0:
......
...@@ -26,11 +26,11 @@ class ExitCommand(Command): ...@@ -26,11 +26,11 @@ class ExitCommand(Command):
""" """
def __init__(self, p_args, p_todolist, p_output, p_error, p_input): def __init__(self, p_args, p_todolist, p_output, p_error, p_input):
super(ExitCommand, self).__init__(p_args, p_todolist, p_output, p_error, super().__init__(p_args, p_todolist, p_output, p_error,
p_input) p_input)
def execute(self): def execute(self):
if not super(ExitCommand, self).execute(): if not super().execute():
return False return False
sys.exit(0) sys.exit(0)
...@@ -28,7 +28,7 @@ class ListCommand(ExpressionCommand): ...@@ -28,7 +28,7 @@ class ListCommand(ExpressionCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(ListCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.printer = None self.printer = None
...@@ -92,7 +92,7 @@ class ListCommand(ExpressionCommand): ...@@ -92,7 +92,7 @@ class ListCommand(ExpressionCommand):
Additional filters to select particular todo items given with the -i Additional filters to select particular todo items given with the -i
flag. flag.
""" """
filters = super(ListCommand, self)._filters() filters = super()._filters()
if self.ids: if self.ids:
def get_todo(p_id): def get_todo(p_id):
...@@ -132,7 +132,7 @@ class ListCommand(ExpressionCommand): ...@@ -132,7 +132,7 @@ class ListCommand(ExpressionCommand):
self.out(self.printer.print_list(self._view().todos)) self.out(self.printer.print_list(self._view().todos))
def execute(self): def execute(self):
if not super(ListCommand, self).execute(): if not super().execute():
return False return False
try: try:
......
...@@ -22,11 +22,11 @@ class ListContextCommand(Command): ...@@ -22,11 +22,11 @@ class ListContextCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(ListContextCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def execute(self): def execute(self):
if not super(ListContextCommand, self).execute(): if not super().execute():
return False return False
for context in sorted(self.todolist.contexts(), key=lambda s: s.lower()): for context in sorted(self.todolist.contexts(), key=lambda s: s.lower()):
......
...@@ -22,11 +22,11 @@ class ListProjectCommand(Command): ...@@ -22,11 +22,11 @@ class ListProjectCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(ListProjectCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def execute(self): def execute(self):
if not super(ListProjectCommand, self).execute(): if not super().execute():
return False return False
for project in sorted(self.todolist.projects(), key=lambda s: s.lower()): for project in sorted(self.todolist.projects(), key=lambda s: s.lower()):
......
...@@ -28,7 +28,7 @@ class PostponeCommand(MultiCommand): ...@@ -28,7 +28,7 @@ class PostponeCommand(MultiCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(PostponeCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.move_start_date = False self.move_start_date = False
......
...@@ -26,7 +26,7 @@ class PriorityCommand(MultiCommand): ...@@ -26,7 +26,7 @@ class PriorityCommand(MultiCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(PriorityCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.last_argument = True self.last_argument = True
......
...@@ -25,11 +25,11 @@ class RevertCommand(Command): ...@@ -25,11 +25,11 @@ class RevertCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(RevertCommand, self).__init__(p_args, p_todolist, p_out, p_err, super().__init__(p_args, p_todolist, p_out, p_err,
p_prompt) p_prompt)
def execute(self): def execute(self):
if not super(RevertCommand, self).execute(): if not super().execute():
return False return False
archive_file = TodoFile.TodoFile(config().archive()) archive_file = TodoFile.TodoFile(config().archive())
......
...@@ -24,11 +24,11 @@ class SortCommand(Command): ...@@ -24,11 +24,11 @@ class SortCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(SortCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def execute(self): def execute(self):
if not super(SortCommand, self).execute(): if not super().execute():
return False return False
try: try:
......
...@@ -26,7 +26,7 @@ class TagCommand(Command): ...@@ -26,7 +26,7 @@ class TagCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(TagCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.force = False self.force = False
...@@ -124,7 +124,7 @@ class TagCommand(Command): ...@@ -124,7 +124,7 @@ class TagCommand(Command):
self._print() self._print()
def execute(self): def execute(self):
if not super(TagCommand, self).execute(): if not super().execute():
return False return False
self._process_args() self._process_args()
......
...@@ -31,7 +31,7 @@ class DCommand(MultiCommand): ...@@ -31,7 +31,7 @@ class DCommand(MultiCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(DCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.force = False self.force = False
......
...@@ -32,7 +32,7 @@ class ExpressionCommand(Command): ...@@ -32,7 +32,7 @@ class ExpressionCommand(Command):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(ExpressionCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.sort_expression = config().sort_string() self.sort_expression = config().sort_string()
......
...@@ -62,7 +62,7 @@ class GrepFilter(Filter): ...@@ -62,7 +62,7 @@ class GrepFilter(Filter):
""" Matches when the todo text contains a text. """ """ Matches when the todo text contains a text. """
def __init__(self, p_expression, p_case_sensitive=None): def __init__(self, p_expression, p_case_sensitive=None):
super(GrepFilter, self).__init__() super().__init__()
# convert to string in case we receive integers # convert to string in case we receive integers
self.expression = p_expression self.expression = p_expression
...@@ -115,7 +115,7 @@ class DependencyFilter(Filter): ...@@ -115,7 +115,7 @@ class DependencyFilter(Filter):
Pass on a TodoList instance such that the dependencies can be Pass on a TodoList instance such that the dependencies can be
looked up. looked up.
""" """
super(DependencyFilter, self).__init__() super().__init__()
self.todolist = p_todolist self.todolist = p_todolist
def match(self, p_todo): def match(self, p_todo):
...@@ -138,7 +138,7 @@ class InstanceFilter(Filter): ...@@ -138,7 +138,7 @@ class InstanceFilter(Filter):
This is handy for constructing a view given a plain list of Todo items. This is handy for constructing a view given a plain list of Todo items.
""" """
super(InstanceFilter, self).__init__() super().__init__()
self.todos = p_todos self.todos = p_todos
def match(self, p_todo): def match(self, p_todo):
...@@ -154,7 +154,7 @@ class InstanceFilter(Filter): ...@@ -154,7 +154,7 @@ class InstanceFilter(Filter):
class LimitFilter(Filter): class LimitFilter(Filter):
def __init__(self, p_limit): def __init__(self, p_limit):
super(LimitFilter, self).__init__() super().__init__()
self.limit = p_limit self.limit = p_limit
def filter(self, p_todos): def filter(self, p_todos):
...@@ -167,7 +167,7 @@ class OrdinalFilter(Filter): ...@@ -167,7 +167,7 @@ class OrdinalFilter(Filter):
""" Base class for ordinal filters. """ """ Base class for ordinal filters. """
def __init__(self, p_expression, p_pattern): def __init__(self, p_expression, p_pattern):
super(OrdinalFilter, self).__init__() super().__init__()
self.expression = p_expression self.expression = p_expression
...@@ -206,7 +206,7 @@ _ORDINAL_TAG_MATCH = r"(?P<key>[^:]*):" + _OPERATOR_MATCH + _VALUE_MATCH ...@@ -206,7 +206,7 @@ _ORDINAL_TAG_MATCH = r"(?P<key>[^:]*):" + _OPERATOR_MATCH + _VALUE_MATCH
class OrdinalTagFilter(OrdinalFilter): class OrdinalTagFilter(OrdinalFilter):
def __init__(self, p_expression): def __init__(self, p_expression):
super(OrdinalTagFilter, self).__init__(p_expression, _ORDINAL_TAG_MATCH) super().__init__(p_expression, _ORDINAL_TAG_MATCH)
def match(self, p_todo): def match(self, p_todo):
""" """
...@@ -247,7 +247,7 @@ class OrdinalTagFilter(OrdinalFilter): ...@@ -247,7 +247,7 @@ class OrdinalTagFilter(OrdinalFilter):
class _DateAttributeFilter(OrdinalFilter): class _DateAttributeFilter(OrdinalFilter):
def __init__(self, p_expression, p_match, p_getter): def __init__(self, p_expression, p_match, p_getter):
super(_DateAttributeFilter, self).__init__(p_expression, p_match) super().__init__(p_expression, p_match)
self.getter = p_getter self.getter = p_getter
def match(self, p_todo): def match(self, p_todo):
...@@ -268,7 +268,7 @@ _CREATED_MATCH = r'creat(ion|ed?):' + _OPERATOR_MATCH + _VALUE_MATCH ...@@ -268,7 +268,7 @@ _CREATED_MATCH = r'creat(ion|ed?):' + _OPERATOR_MATCH + _VALUE_MATCH
class CreationFilter(_DateAttributeFilter): class CreationFilter(_DateAttributeFilter):
def __init__(self, p_expression): def __init__(self, p_expression):
super(CreationFilter, self).__init__( super().__init__(
p_expression, p_expression,
_CREATED_MATCH, _CREATED_MATCH,
lambda t: t.creation_date() # pragma: no branch lambda t: t.creation_date() # pragma: no branch
...@@ -280,7 +280,7 @@ _COMPLETED_MATCH = r'complet(ed?|ion):' + _OPERATOR_MATCH + _VALUE_MATCH ...@@ -280,7 +280,7 @@ _COMPLETED_MATCH = r'complet(ed?|ion):' + _OPERATOR_MATCH + _VALUE_MATCH
class CompletionFilter(_DateAttributeFilter): class CompletionFilter(_DateAttributeFilter):
def __init__(self, p_expression): def __init__(self, p_expression):
super(CompletionFilter, self).__init__( super().__init__(
p_expression, p_expression,
_COMPLETED_MATCH, _COMPLETED_MATCH,
lambda t: t.completion_date() # pragma: no branch lambda t: t.completion_date() # pragma: no branch
...@@ -292,7 +292,7 @@ _PRIORITY_MATCH = r"\(" + _OPERATOR_MATCH + r"(?P<value>[A-Z]{1})\)" ...@@ -292,7 +292,7 @@ _PRIORITY_MATCH = r"\(" + _OPERATOR_MATCH + r"(?P<value>[A-Z]{1})\)"
class PriorityFilter(OrdinalFilter): class PriorityFilter(OrdinalFilter):
def __init__(self, p_expression): def __init__(self, p_expression):
super(PriorityFilter, self).__init__(p_expression, _PRIORITY_MATCH) super().__init__(p_expression, _PRIORITY_MATCH)
def match(self, p_todo): def match(self, p_todo):
""" """
......
...@@ -66,7 +66,7 @@ class IcalPrinter(Printer): ...@@ -66,7 +66,7 @@ class IcalPrinter(Printer):
""" """
def __init__(self, p_todolist): def __init__(self, p_todolist):
super(IcalPrinter, self).__init__() super().__init__()
self.todolist = p_todolist self.todolist = p_todolist
try: try:
......
...@@ -52,7 +52,7 @@ class JsonPrinter(Printer): ...@@ -52,7 +52,7 @@ class JsonPrinter(Printer):
""" """
def __init__(self): def __init__(self):
super(JsonPrinter, self).__init__() super().__init__()
def print_todo(self, p_todo): def print_todo(self, p_todo):
return json.dumps(_convert_todo(p_todo), ensure_ascii=False, return json.dumps(_convert_todo(p_todo), ensure_ascii=False,
......
...@@ -27,7 +27,7 @@ class MultiCommand(ExpressionCommand): ...@@ -27,7 +27,7 @@ class MultiCommand(ExpressionCommand):
p_out=lambda a: None, p_out=lambda a: None,
p_err=lambda a: None, p_err=lambda a: None,
p_prompt=lambda a: None): p_prompt=lambda a: None):
super(MultiCommand, self).__init__( super().__init__(
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
self.todos = [] self.todos = []
...@@ -114,7 +114,7 @@ class MultiCommand(ExpressionCommand): ...@@ -114,7 +114,7 @@ class MultiCommand(ExpressionCommand):
raise NotImplementedError raise NotImplementedError
def execute(self): def execute(self):
if not super(MultiCommand, self).execute(): if not super().execute():
return False return False
self._process_flags() self._process_flags()
......
...@@ -50,7 +50,7 @@ class PrettyPrinter(Printer): ...@@ -50,7 +50,7 @@ class PrettyPrinter(Printer):
""" """
Constructor. Constructor.
""" """
super(PrettyPrinter, self).__init__() super().__init__()
self.filters = [] self.filters = []
def add_filter(self, p_filter): def add_filter(self, p_filter):
......
...@@ -41,7 +41,7 @@ class TodoList(TodoListBase): ...@@ -41,7 +41,7 @@ class TodoList(TodoListBase):
self._tododict = {} # hash(todo) to todo lookup self._tododict = {} # hash(todo) to todo lookup
self._depgraph = DirectedGraph() self._depgraph = DirectedGraph()
super(TodoList, self).__init__(p_todostrings) super().__init__(p_todostrings)
def todo_by_dep_id(self, p_dep_id): def todo_by_dep_id(self, p_dep_id):
""" """
......
...@@ -25,7 +25,7 @@ from topydo.lib.ListFormat import ListFormatParser ...@@ -25,7 +25,7 @@ from topydo.lib.ListFormat import ListFormatParser
class PrettyPrinterFormatFilter(PrettyPrinterFilter): class PrettyPrinterFormatFilter(PrettyPrinterFilter):
def __init__(self, p_todolist, p_format=None): def __init__(self, p_todolist, p_format=None):
super(PrettyPrinterFormatFilter, self).__init__() super().__init__()
self.parser = ListFormatParser(p_todolist, p_format) self.parser = ListFormatParser(p_todolist, p_format)
def filter(self, p_todo_str, p_todo): def filter(self, p_todo_str, p_todo):
......
...@@ -23,7 +23,7 @@ class PrettyPrinterNumbers(PrettyPrinterFilter): ...@@ -23,7 +23,7 @@ class PrettyPrinterNumbers(PrettyPrinterFilter):
""" Prepends the todo's number, retrieved from the todolist. """ """ Prepends the todo's number, retrieved from the todolist. """
def __init__(self, p_todolist): def __init__(self, p_todolist):
super(PrettyPrinterNumbers, self).__init__() super().__init__()
self.todolist = p_todolist self.todolist = p_todolist
def filter(self, p_todo_str, p_todo): def filter(self, p_todo_str, p_todo):
......
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