Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
d5c1b4ec
Commit
d5c1b4ec
authored
Jun 05, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let abstract implementations raise NotImplementedError.
parent
58c33a93
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
18 deletions
+18
-18
topydo/commands/DCommand.py
topydo/commands/DCommand.py
+6
-8
topydo/commands/ListCommand.py
topydo/commands/ListCommand.py
+2
-2
topydo/lib/Command.py
topydo/lib/Command.py
+4
-2
topydo/lib/Filter.py
topydo/lib/Filter.py
+1
-2
topydo/lib/PrettyPrinter.py
topydo/lib/PrettyPrinter.py
+1
-2
topydo/lib/PrettyPrinterFilter.py
topydo/lib/PrettyPrinterFilter.py
+4
-2
No files found.
topydo/commands/DCommand.py
View file @
d5c1b4ec
...
...
@@ -44,8 +44,7 @@ class DCommand(MultiCommand):
return
(
""
,
[])
def
process_flag
(
self
,
p_option
,
p_value
):
""" Default implementation of processing specific flags. """
pass
raise
NotImplementedError
def
process_flags
(
self
):
opts
,
args
=
self
.
get_flags
()
...
...
@@ -71,11 +70,10 @@ class DCommand(MultiCommand):
self
.
out
(
printer
.
print_list
(
p_todos
))
def
prompt_text
(
self
):
r
eturn
"Yes or no? [y/N] "
r
aise
NotImplementedError
def
prefix
(
self
):
""" Prefix to use when printing a todo. """
return
""
raise
NotImplementedError
def
_process_subtasks
(
self
,
p_todo
):
children
=
self
.
_uncompleted_children
(
p_todo
)
...
...
@@ -116,17 +114,17 @@ class DCommand(MultiCommand):
return
True
def
condition_failed_text
(
self
):
r
eturn
""
r
aise
NotImplementedError
def
execute_specific
(
self
,
_
):
pass
raise
NotImplementedError
def
execute_specific_core
(
self
,
p_todo
):
"""
The core operation on the todo itself. Also used to operate on
child/parent tasks.
"""
pass
raise
NotImplementedError
def
execute_multi_specific
(
self
):
old_active
=
self
.
_active_todos
()
...
...
topydo/commands/ListCommand.py
View file @
d5c1b4ec
...
...
@@ -46,7 +46,7 @@ class ListCommand(ExpressionCommand):
"""
try
:
import
icalendar
as
_
except
ImportError
:
except
ImportError
:
# pragma: no cover
self
.
error
(
"icalendar package is not installed."
)
return
False
...
...
@@ -101,7 +101,7 @@ class ListCommand(ExpressionCommand):
try
:
self
.
_process_flags
()
except
SyntaxError
:
except
SyntaxError
:
# pragma: no cover
# importing icalendar failed, most likely due to Python 3.2
self
.
error
(
"icalendar is not supported in this Python version."
)
return
False
...
...
topydo/lib/Command.py
View file @
d5c1b4ec
...
...
@@ -84,8 +84,10 @@ class Command(object):
return
result
def
usage
(
self
):
return
"No usage text available for this command."
""" Returns a one-line synopsis for this command. """
raise
NotImplementedError
def
help
(
self
):
return
"No help text available for this command."
""" Returns the help text for this command. """
raise
NotImplementedError
topydo/lib/Filter.py
View file @
d5c1b4ec
...
...
@@ -29,8 +29,7 @@ class Filter(object):
return
[
t
for
t
in
p_todos
if
self
.
match
(
t
)]
def
match
(
self
,
_
):
""" Default match value. """
return
True
raise
NotImplementedError
class
NegationFilter
(
Filter
):
def
__init__
(
self
,
p_filter
):
...
...
topydo/lib/PrettyPrinter.py
View file @
d5c1b4ec
...
...
@@ -26,8 +26,7 @@ class Printer(object):
Subclasses must at least implement the print_todo method.
"""
def
print_todo
(
self
,
p_todo
):
""" Base implementation."""
return
p_todo
.
source
()
raise
NotImplementedError
def
print_list
(
self
,
p_todos
):
"""
...
...
topydo/lib/PrettyPrinterFilter.py
View file @
d5c1b4ec
...
...
@@ -30,8 +30,10 @@ class PrettyPrinterFilter(object):
"""
def
filter
(
self
,
p_todo_str
,
_
):
""" Default implementation returns an unmodified todo string. """
return
p_todo_str
"""
Applies a filter to p_todo_str and returns a modified version of it.
"""
raise
NotImplementedError
class
PrettyPrinterColorFilter
(
PrettyPrinterFilter
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment