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
d58811de
Commit
d58811de
authored
Jun 13, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various issues after testing.
parent
aa3e8351
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
TodoList.py
TodoList.py
+13
-5
No files found.
TodoList.py
View file @
d58811de
...
...
@@ -36,15 +36,23 @@ class TodoList(object):
return
result
def
add
(
self
,
p_
item
):
def
add
(
self
,
p_
src
):
"""
Given a
Todo(Base) item, add
it to the end of the list.
Given a
todo string, parse it and put
it to the end of the list.
"""
self
.
_todos
.
append
(
p_item
)
todo
=
Todo
.
Todo
(
p_src
)
self
.
_todos
.
append
(
todo
)
def
delete
(
self
,
p_number
):
""" Deletes a todo item from the list. """
del
self
.
_todos
[
p_number
-
1
]
try
:
del
self
.
_todos
[
p_number
-
1
]
except
IndexError
:
pass
# just ignore it
def
count
(
self
):
""" Returns the number of todos on this list. """
return
len
(
self
.
_todos
)
def
append
(
self
,
p_number
,
p_string
):
"""
...
...
@@ -54,7 +62,7 @@ class TodoList(object):
"""
if
len
(
p_string
)
>
0
:
todo
=
self
.
todo
(
p_number
)
new_text
=
todo
.
text
()
+
' '
+
p_string
new_text
=
todo
.
source
()
+
' '
+
p_string
todo
.
set_text
(
new_text
)
def
set_completed
(
self
,
p_number
):
...
...
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