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
4b1bbdb8
Commit
4b1bbdb8
authored
Jun 10, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create TodoWidget that shows priority and text.
parent
667082b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
topydo/ui/TodoListWidget.py
topydo/ui/TodoListWidget.py
+3
-1
topydo/ui/TodoWidget.py
topydo/ui/TodoWidget.py
+42
-0
No files found.
topydo/ui/TodoListWidget.py
View file @
4b1bbdb8
...
...
@@ -16,6 +16,8 @@
import
urwid
from
topydo.ui.TodoWidget
import
TodoWidget
class
TodoListWidget
(
urwid
.
WidgetWrap
):
def
__init__
(
self
,
p_view
,
p_title
):
self
.
view
=
p_view
...
...
@@ -25,7 +27,7 @@ class TodoListWidget(urwid.WidgetWrap):
todos
=
[]
for
todo
in
self
.
view
.
todos
:
todos
.
append
((
'pack'
,
urwid
.
Text
(
todo
.
source
()
)))
todos
.
append
((
'pack'
,
TodoWidget
(
todo
)))
todos
.
append
(
urwid
.
Divider
(
u'-'
))
todo_pile
=
urwid
.
Pile
(
todos
)
...
...
topydo/ui/TodoWidget.py
0 → 100644
View file @
4b1bbdb8
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2015 Bram Schoenmakers <me@bramschoenmakers.nl>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
urwid
class
TodoWidget
(
urwid
.
WidgetWrap
):
def
__init__
(
self
,
p_todo
):
priority
=
p_todo
.
priority
()
priority_text
=
u""
todo_text
=
p_todo
.
source
()
if
priority
:
priority_text
=
"({})"
.
format
(
priority
)
# strip the first characters off
todo_text
=
todo_text
[
4
:]
priority_widget
=
urwid
.
Text
(
priority_text
)
text_widget
=
urwid
.
Text
(
todo_text
)
columns
=
urwid
.
Columns
(
[
(
3
,
priority_widget
),
(
'weight'
,
1
,
text_widget
),
],
dividechars
=
1
)
super
(
TodoWidget
,
self
).
__init__
(
columns
)
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