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
fea7de85
Commit
fea7de85
authored
Nov 22, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style fixes.
parent
9987d65a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
topydo/cli/Main.py
topydo/cli/Main.py
+18
-3
No files found.
topydo/cli/Main.py
View file @
fea7de85
...
...
@@ -61,8 +61,8 @@ from topydo.lib.Config import config, ConfigError
# make sure to bail out if the configuration is invalid.
try
:
config
()
except
ConfigError
as
e
:
error
(
str
(
e
))
except
ConfigError
as
config_error
:
error
(
str
(
config_error
))
exit
(
1
)
from
topydo.lib.AddCommand
import
AddCommand
...
...
@@ -85,6 +85,11 @@ from topydo.lib import TodoListBase
from
topydo.lib.Utils
import
escape_ansi
class
CLIApplication
(
object
):
"""
Class that represents the Command Line Interface of Topydo.
Handles input/output of the various subcommand.
"""
def
__init__
(
self
):
self
.
todolist
=
TodoList
.
TodoList
([])
...
...
@@ -106,7 +111,17 @@ class CLIApplication(object):
archive_file
.
write
(
str
(
archive
))
def
execute
(
self
,
p_command
,
p_args
):
command
=
p_command
(
p_args
,
self
.
todolist
,
lambda
o
:
write
(
sys
.
stdout
,
o
),
error
,
raw_input
)
"""
Execute a subcommand with arguments. p_command is a class (not an
object).
"""
command
=
p_command
(
p_args
,
self
.
todolist
,
lambda
o
:
write
(
sys
.
stdout
,
o
),
error
,
raw_input
)
return
False
if
command
.
execute
()
==
False
else
True
def
run
(
self
):
...
...
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