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
e86b3287
Commit
e86b3287
authored
Jun 14, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow commands to request user input.
parent
d7f9f5c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
topydo/ui/Main.py
topydo/ui/Main.py
+14
-1
No files found.
topydo/ui/Main.py
View file @
e86b3287
...
...
@@ -72,7 +72,7 @@ class UIApplication(CLIApplicationBase):
self
.
todolist
,
p_output
,
self
.
_output
,
lambda
_
:
None
,
# TODO input
self
.
_input
,
)
if
command
.
execute
()
!=
False
:
...
...
@@ -152,6 +152,19 @@ class UIApplication(CLIApplicationBase):
self
.
console
.
print_text
(
p_text
)
def
_input
(
self
,
p_question
):
self
.
_print_to_console
(
p_question
)
# don't wait for the event loop to enter idle, there is a command
# waiting for input right now, so already go ahead and draw the
# question on screen.
self
.
mainloop
.
draw_screen
()
user_input
=
self
.
mainloop
.
screen
.
get_input
()
self
.
_hide_console
()
return
user_input
[
0
]
def
run
(
self
):
self
.
todofile
=
TodoFile
.
TodoFile
(
config
().
todotxt
())
self
.
todolist
=
TodoList
.
TodoList
(
self
.
todofile
.
read
())
...
...
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