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
04638cb0
Commit
04638cb0
authored
Oct 09, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add list command.
parent
738b1a04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
ListCommand.py
ListCommand.py
+20
-0
Main.py
Main.py
+3
-10
No files found.
ListCommand.py
0 → 100644
View file @
04638cb0
import
Command
import
Config
import
Filter
import
Sorter
class
ListCommand
(
Command
.
Command
):
def
__init__
(
self
,
p_args
,
p_todolist
):
super
(
ListCommand
,
self
).
__init__
(
p_args
,
p_todolist
)
def
execute
(
self
):
sorter
=
Sorter
.
Sorter
(
Config
.
SORT_STRING
)
filters
=
[
Filter
.
DependencyFilter
(
self
.
todolist
),
Filter
.
RelevanceFilter
()]
if
len
(
self
.
args
)
>
0
:
filters
.
append
(
Filter
.
GrepFilter
(
self
.
argument
(
0
)))
print
self
.
todolist
.
view
(
sorter
,
filters
).
pretty_print
()
# FIXME
return
True
Main.py
View file @
04638cb0
...
@@ -8,10 +8,9 @@ from AppendCommand import AppendCommand
...
@@ -8,10 +8,9 @@ from AppendCommand import AppendCommand
from
DepCommand
import
DepCommand
from
DepCommand
import
DepCommand
import
Config
import
Config
from
DoCommand
import
DoCommand
from
DoCommand
import
DoCommand
import
Filter
from
ListCommand
import
ListCommand
from
PrettyPrinter
import
pretty_print
from
PrettyPrinter
import
pretty_print
from
PriorityCommand
import
PriorityCommand
from
PriorityCommand
import
PriorityCommand
import
Sorter
import
TodoFile
import
TodoFile
import
TodoList
import
TodoList
from
Utils
import
convert_todo_number
from
Utils
import
convert_todo_number
...
@@ -86,14 +85,8 @@ class Application(object): # TODO: rename to CLIApplication
...
@@ -86,14 +85,8 @@ class Application(object): # TODO: rename to CLIApplication
command
.
execute
()
command
.
execute
()
def
list
(
self
):
def
list
(
self
):
sorter
=
Sorter
.
Sorter
(
Config
.
SORT_STRING
)
command
=
ListCommand
(
arguments
(),
self
.
todolist
)
filters
=
[
Filter
.
DependencyFilter
(
self
.
todolist
),
command
.
execute
()
Filter
.
RelevanceFilter
()]
if
len
(
sys
.
argv
)
>
2
:
filters
.
append
(
Filter
.
GrepFilter
(
sys
.
argv
[
2
]))
print
self
.
todolist
.
view
(
sorter
,
filters
).
pretty_print
()
def
run
(
self
):
def
run
(
self
):
""" Main entry function. """
""" Main entry function. """
...
...
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