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
0f311587
Commit
0f311587
authored
Oct 08, 2015
by
MinchinWeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PEP8 E711
comparison to None should be 'if cond is None:' or 'if cond is not None:'
parent
17671303
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
12 deletions
+11
-12
topydo/cli/CLI.py
topydo/cli/CLI.py
+1
-1
topydo/cli/CLIApplicationBase.py
topydo/cli/CLIApplicationBase.py
+1
-1
topydo/commands/ListCommand.py
topydo/commands/ListCommand.py
+1
-1
topydo/commands/TagCommand.py
topydo/commands/TagCommand.py
+1
-1
topydo/lib/Config.py
topydo/lib/Config.py
+2
-2
topydo/lib/Filter.py
topydo/lib/Filter.py
+1
-1
topydo/lib/TodoBase.py
topydo/lib/TodoBase.py
+3
-4
topydo/lib/Utils.py
topydo/lib/Utils.py
+1
-1
No files found.
topydo/cli/CLI.py
View file @
0f311587
...
@@ -51,7 +51,7 @@ class CLIApplication(CLIApplicationBase):
...
@@ -51,7 +51,7 @@ class CLIApplication(CLIApplicationBase):
(
subcommand
,
args
)
=
get_subcommand
(
args
)
(
subcommand
,
args
)
=
get_subcommand
(
args
)
if
subcommand
==
None
:
if
subcommand
is
None
:
self
.
_usage
()
self
.
_usage
()
if
self
.
_execute
(
subcommand
,
args
)
==
False
:
if
self
.
_execute
(
subcommand
,
args
)
==
False
:
...
...
topydo/cli/CLIApplicationBase.py
View file @
0f311587
...
@@ -178,7 +178,7 @@ class CLIApplicationBase(object):
...
@@ -178,7 +178,7 @@ class CLIApplicationBase(object):
archive_file
.
write
(
archive
.
print_todos
())
archive_file
.
write
(
archive
.
print_todos
())
def
_help
(
self
,
args
):
def
_help
(
self
,
args
):
if
args
==
None
:
if
args
is
None
:
pass
# TODO
pass
# TODO
else
:
else
:
pass
# TODO
pass
# TODO
...
...
topydo/commands/ListCommand.py
View file @
0f311587
...
@@ -78,7 +78,7 @@ class ListCommand(ExpressionCommand):
...
@@ -78,7 +78,7 @@ class ListCommand(ExpressionCommand):
sent to the output.
sent to the output.
"""
"""
if
self
.
printer
==
None
:
if
self
.
printer
is
None
:
# create a standard printer with some filters
# create a standard printer with some filters
indent
=
config
().
list_indent
()
indent
=
config
().
list_indent
()
hidden_tags
=
config
().
hidden_tags
()
hidden_tags
=
config
().
hidden_tags
()
...
...
topydo/commands/TagCommand.py
View file @
0f311587
...
@@ -104,7 +104,7 @@ class TagCommand(Command):
...
@@ -104,7 +104,7 @@ class TagCommand(Command):
if
answer
==
"all"
:
if
answer
==
"all"
:
for
value
in
self
.
current_values
:
for
value
in
self
.
current_values
:
self
.
_set_helper
(
value
)
self
.
_set_helper
(
value
)
elif
answer
!=
None
and
self
.
value
!=
self
.
current_values
[
answer
]:
elif
answer
is
not
None
and
self
.
value
!=
self
.
current_values
[
answer
]:
self
.
_set_helper
(
self
.
current_values
[
answer
])
self
.
_set_helper
(
self
.
current_values
[
answer
])
else
:
else
:
...
...
topydo/lib/Config.py
View file @
0f311587
...
@@ -102,7 +102,7 @@ class _Config:
...
@@ -102,7 +102,7 @@ class _Config:
# when a path is given, *only* use the values in that file, or the
# when a path is given, *only* use the values in that file, or the
# defaults listed above.
# defaults listed above.
if
p_path
!=
None
:
if
p_path
is
not
None
:
files
=
[
p_path
]
files
=
[
p_path
]
self
.
cp
.
read
(
files
)
self
.
cp
.
read
(
files
)
...
@@ -269,7 +269,7 @@ def config(p_path=None, p_overrides=None):
...
@@ -269,7 +269,7 @@ def config(p_path=None, p_overrides=None):
passed value instead. Structure: (section, option) => value
passed value instead. Structure: (section, option) => value
The previous configuration instance will be discarded.
The previous configuration instance will be discarded.
"""
"""
if
not
config
.
instance
or
p_path
!=
None
or
p_overrides
!=
None
:
if
not
config
.
instance
or
p_path
is
not
None
or
p_overrides
is
not
None
:
try
:
try
:
config
.
instance
=
_Config
(
p_path
,
p_overrides
)
config
.
instance
=
_Config
(
p_path
,
p_overrides
)
except
configparser
.
ParsingError
as
perr
:
except
configparser
.
ParsingError
as
perr
:
...
...
topydo/lib/Filter.py
View file @
0f311587
...
@@ -68,7 +68,7 @@ class GrepFilter(Filter):
...
@@ -68,7 +68,7 @@ class GrepFilter(Filter):
# convert to string in case we receive integers
# convert to string in case we receive integers
self
.
expression
=
p_expression
self
.
expression
=
p_expression
if
p_case_sensitive
!=
None
:
if
p_case_sensitive
is
not
None
:
self
.
case_sensitive
=
p_case_sensitive
self
.
case_sensitive
=
p_case_sensitive
else
:
else
:
# only be case sensitive when the expression contains at least one
# only be case sensitive when the expression contains at least one
...
...
topydo/lib/TodoBase.py
View file @
0f311587
...
@@ -146,12 +146,11 @@ class TodoBase(object):
...
@@ -146,12 +146,11 @@ class TodoBase(object):
the task was completed.
the task was completed.
"""
"""
if not self.is_completed() and
if not self.is_completed() and (p_priority is None or
(p_priority == None or is_valid_priority(p_priority)):
is_valid_priority(p_priority)):
self.fields['
priority
'] = p_priority
self.fields['
priority
'] = p_priority
priority_str = '' if p_priority
==
None else '
(
' + p_priority + '
)
'
priority_str = '' if p_priority
is
None else '
(
' + p_priority + '
)
'
self.src = re.sub(r'
^
(
\
([
A
-
Z
]
\
)
)
?
', priority_str, self.src)
self.src = re.sub(r'
^
(
\
([
A
-
Z
]
\
)
)
?
', priority_str, self.src)
def priority(self):
def priority(self):
...
...
topydo/lib/Utils.py
View file @
0f311587
...
@@ -44,7 +44,7 @@ def date_string_to_date(p_date):
...
@@ -44,7 +44,7 @@ def date_string_to_date(p_date):
def
is_valid_priority
(
p_priority
):
def
is_valid_priority
(
p_priority
):
return
p_priority
!=
None
and
re
.
match
(
r'^[A-Z]$'
,
p_priority
)
!=
None
return
p_priority
is
not
None
and
re
.
match
(
r'^[A-Z]$'
,
p_priority
)
is
not
None
def
escape_ansi
(
p_string
):
def
escape_ansi
(
p_string
):
...
...
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