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):
...
@@ -44,8 +44,7 @@ class DCommand(MultiCommand):
return
(
""
,
[])
return
(
""
,
[])
def
process_flag
(
self
,
p_option
,
p_value
):
def
process_flag
(
self
,
p_option
,
p_value
):
""" Default implementation of processing specific flags. """
raise
NotImplementedError
pass
def
process_flags
(
self
):
def
process_flags
(
self
):
opts
,
args
=
self
.
get_flags
()
opts
,
args
=
self
.
get_flags
()
...
@@ -71,11 +70,10 @@ class DCommand(MultiCommand):
...
@@ -71,11 +70,10 @@ class DCommand(MultiCommand):
self
.
out
(
printer
.
print_list
(
p_todos
))
self
.
out
(
printer
.
print_list
(
p_todos
))
def
prompt_text
(
self
):
def
prompt_text
(
self
):
r
eturn
"Yes or no? [y/N] "
r
aise
NotImplementedError
def
prefix
(
self
):
def
prefix
(
self
):
""" Prefix to use when printing a todo. """
raise
NotImplementedError
return
""
def
_process_subtasks
(
self
,
p_todo
):
def
_process_subtasks
(
self
,
p_todo
):
children
=
self
.
_uncompleted_children
(
p_todo
)
children
=
self
.
_uncompleted_children
(
p_todo
)
...
@@ -116,17 +114,17 @@ class DCommand(MultiCommand):
...
@@ -116,17 +114,17 @@ class DCommand(MultiCommand):
return
True
return
True
def
condition_failed_text
(
self
):
def
condition_failed_text
(
self
):
r
eturn
""
r
aise
NotImplementedError
def
execute_specific
(
self
,
_
):
def
execute_specific
(
self
,
_
):
pass
raise
NotImplementedError
def
execute_specific_core
(
self
,
p_todo
):
def
execute_specific_core
(
self
,
p_todo
):
"""
"""
The core operation on the todo itself. Also used to operate on
The core operation on the todo itself. Also used to operate on
child/parent tasks.
child/parent tasks.
"""
"""
pass
raise
NotImplementedError
def
execute_multi_specific
(
self
):
def
execute_multi_specific
(
self
):
old_active
=
self
.
_active_todos
()
old_active
=
self
.
_active_todos
()
...
...
topydo/commands/ListCommand.py
View file @
d5c1b4ec
...
@@ -46,7 +46,7 @@ class ListCommand(ExpressionCommand):
...
@@ -46,7 +46,7 @@ class ListCommand(ExpressionCommand):
"""
"""
try
:
try
:
import
icalendar
as
_
import
icalendar
as
_
except
ImportError
:
except
ImportError
:
# pragma: no cover
self
.
error
(
"icalendar package is not installed."
)
self
.
error
(
"icalendar package is not installed."
)
return
False
return
False
...
@@ -101,7 +101,7 @@ class ListCommand(ExpressionCommand):
...
@@ -101,7 +101,7 @@ class ListCommand(ExpressionCommand):
try
:
try
:
self
.
_process_flags
()
self
.
_process_flags
()
except
SyntaxError
:
except
SyntaxError
:
# pragma: no cover
# importing icalendar failed, most likely due to Python 3.2
# importing icalendar failed, most likely due to Python 3.2
self
.
error
(
"icalendar is not supported in this Python version."
)
self
.
error
(
"icalendar is not supported in this Python version."
)
return
False
return
False
...
...
topydo/lib/Command.py
View file @
d5c1b4ec
...
@@ -84,8 +84,10 @@ class Command(object):
...
@@ -84,8 +84,10 @@ class Command(object):
return
result
return
result
def
usage
(
self
):
def
usage
(
self
):
return
"No usage text available for this command."
""" Returns a one-line synopsis for this command. """
raise
NotImplementedError
def
help
(
self
):
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):
...
@@ -29,8 +29,7 @@ class Filter(object):
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
,
_
):
""" Default match value. """
raise
NotImplementedError
return
True
class
NegationFilter
(
Filter
):
class
NegationFilter
(
Filter
):
def
__init__
(
self
,
p_filter
):
def
__init__
(
self
,
p_filter
):
...
...
topydo/lib/PrettyPrinter.py
View file @
d5c1b4ec
...
@@ -26,8 +26,7 @@ class Printer(object):
...
@@ -26,8 +26,7 @@ class Printer(object):
Subclasses must at least implement the print_todo method.
Subclasses must at least implement the print_todo method.
"""
"""
def
print_todo
(
self
,
p_todo
):
def
print_todo
(
self
,
p_todo
):
""" Base implementation."""
raise
NotImplementedError
return
p_todo
.
source
()
def
print_list
(
self
,
p_todos
):
def
print_list
(
self
,
p_todos
):
"""
"""
...
...
topydo/lib/PrettyPrinterFilter.py
View file @
d5c1b4ec
...
@@ -30,8 +30,10 @@ class PrettyPrinterFilter(object):
...
@@ -30,8 +30,10 @@ class PrettyPrinterFilter(object):
"""
"""
def
filter
(
self
,
p_todo_str
,
_
):
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
):
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