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): ...@@ -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:
......
...@@ -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
......
...@@ -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()
......
...@@ -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:
......
...@@ -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:
......
...@@ -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
......
...@@ -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):
......
...@@ -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):
......
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