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
8fdf22e5
Commit
8fdf22e5
authored
Nov 23, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace dangerous (mutable) default value.
parent
c6015996
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
topydo/lib/Command.py
topydo/lib/Command.py
+3
-1
topydo/lib/PrettyPrinter.py
topydo/lib/PrettyPrinter.py
+4
-2
topydo/lib/View.py
topydo/lib/View.py
+2
-1
No files found.
topydo/lib/Command.py
View file @
8fdf22e5
...
...
@@ -70,7 +70,9 @@ class Command(object):
return
value
def
getopt
(
self
,
p_flags
,
p_long
=
[]):
def
getopt
(
self
,
p_flags
,
p_long
=
None
):
p_long
=
p_long
or
[]
try
:
result
=
getopt
.
getopt
(
self
.
args
,
p_flags
,
p_long
)
except
getopt
.
GetoptError
as
goe
:
...
...
topydo/lib/PrettyPrinter.py
View file @
8fdf22e5
...
...
@@ -58,7 +58,7 @@ def pp_color(p_todo_str, p_todo):
def
pp_indent
(
p_indent
=
0
):
return
lambda
s
,
t
:
' '
*
p_indent
+
s
def
pretty_print
(
p_todo
,
p_filters
=
[]
):
def
pretty_print
(
p_todo
,
p_filters
=
None
):
"""
Given a todo item, pretty print it and return a list of formatted strings.
...
...
@@ -70,6 +70,7 @@ def pretty_print(p_todo, p_filters=[]):
Example is pp_color in this fle.
"""
p_filters
=
p_filters
or
[]
todo_str
=
str
(
p_todo
)
...
...
@@ -78,9 +79,10 @@ def pretty_print(p_todo, p_filters=[]):
return
todo_str
def
pretty_print_list
(
p_todos
,
p_filters
=
[]
):
def
pretty_print_list
(
p_todos
,
p_filters
=
None
):
"""
Given a list of todo items, pretty print it and return a list of
formatted strings.
"""
p_filters
=
p_filters
or
[]
return
[
pretty_print
(
todo
,
p_filters
)
for
todo
in
p_todos
]
topydo/lib/View.py
View file @
8fdf22e5
...
...
@@ -42,8 +42,9 @@ class View(object):
for
_filter
in
self
.
_filters
:
self
.
_viewdata
=
_filter
.
filter
(
self
.
_viewdata
)
def
pretty_print
(
self
,
p_pp_filters
=
[]
):
def
pretty_print
(
self
,
p_pp_filters
=
None
):
""" Pretty prints the view. """
p_pp_filters
=
p_pp_filters
or
[]
pp_filters
=
[
self
.
_todolist
.
pp_number
(),
pp_color
]
+
p_pp_filters
return
'
\
n
'
.
join
(
pretty_print_list
(
self
.
_viewdata
,
pp_filters
))
...
...
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