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
a182079b
Commit
a182079b
authored
Oct 12, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate number attribute stored in each todo.
Now, the todolist is the owner of the numbers.
parent
57cdffa2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Todo.py
Todo.py
+1
-1
TodoList.py
TodoList.py
+3
-2
No files found.
Todo.py
View file @
a182079b
...
...
@@ -16,7 +16,7 @@ class Todo(TodoBase.TodoBase):
def
__init__
(
self
,
p_str
):
TodoBase
.
TodoBase
.
__init__
(
self
,
p_str
)
self
.
attributes
=
{
'number'
:
-
1
}
self
.
attributes
=
{}
def
get_date
(
self
,
p_tag
):
""" Given a date tag, return a date object. """
...
...
TodoList.py
View file @
a182079b
...
...
@@ -24,6 +24,7 @@ class TodoList(object):
The string will be parsed.
"""
self
.
_todos
=
[]
self
.
_numbers
=
{}
# maintains todo -> number mapping
self
.
_depgraph
=
Graph
.
DirectedGraph
()
for
string
in
p_todostrings
:
...
...
@@ -104,7 +105,7 @@ class TodoList(object):
Then there will be an edge 1 --> 2 with ID 4.
"""
p_todo.attributes['
number
'
] = len(self._todos) + 1
self._numbers[p_todo
] = len(self._todos) + 1
self._todos.append(p_todo)
self._maintain_dep_graph(p_todo)
...
...
@@ -291,7 +292,7 @@ class TodoList(object):
self.dirty = True
def number(self, p_todo):
return
p_todo.attributes['number'] # TODO: do the lookup
return
self._numbers[p_todo]
def pp_number(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