Commit 0f311587 authored by MinchinWeb's avatar MinchinWeb

Fix PEP8 E711

comparison to None should be 'if cond is None:' or 'if cond is not None:'
parent 17671303
......@@ -51,7 +51,7 @@ class CLIApplication(CLIApplicationBase):
(subcommand, args) = get_subcommand(args)
if subcommand == None:
if subcommand is None:
self._usage()
if self._execute(subcommand, args) == False:
......
......@@ -178,7 +178,7 @@ class CLIApplicationBase(object):
archive_file.write(archive.print_todos())
def _help(self, args):
if args == None:
if args is None:
pass # TODO
else:
pass # TODO
......
......@@ -78,7 +78,7 @@ class ListCommand(ExpressionCommand):
sent to the output.
"""
if self.printer == None:
if self.printer is None:
# create a standard printer with some filters
indent = config().list_indent()
hidden_tags = config().hidden_tags()
......
......@@ -104,7 +104,7 @@ class TagCommand(Command):
if answer == "all":
for value in self.current_values:
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])
else:
......
......@@ -102,7 +102,7 @@ class _Config:
# when a path is given, *only* use the values in that file, or the
# defaults listed above.
if p_path != None:
if p_path is not None:
files = [p_path]
self.cp.read(files)
......@@ -269,7 +269,7 @@ def config(p_path=None, p_overrides=None):
passed value instead. Structure: (section, option) => value
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:
config.instance = _Config(p_path, p_overrides)
except configparser.ParsingError as perr:
......
......@@ -68,7 +68,7 @@ class GrepFilter(Filter):
# convert to string in case we receive integers
self.expression = p_expression
if p_case_sensitive != None:
if p_case_sensitive is not None:
self.case_sensitive = p_case_sensitive
else:
# only be case sensitive when the expression contains at least one
......
......@@ -146,12 +146,11 @@ class TodoBase(object):
the task was completed.
"""
if not self.is_completed() and
(p_priority == None or is_valid_priority(p_priority)):
if not self.is_completed() and (p_priority is None or
is_valid_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)
def priority(self):
......
......@@ -44,7 +44,7 @@ def date_string_to_date(p_date):
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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment