aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/command/util.py')
-rw-r--r--libbe/command/util.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbe/command/util.py b/libbe/command/util.py
index 49f3490..632e22c 100644
--- a/libbe/command/util.py
+++ b/libbe/command/util.py
@@ -38,7 +38,7 @@ def complete_command(command, argument, fragment=None):
def comp_path(fragment=None):
"""List possible path completions for fragment."""
- if fragment == None:
+ if fragment is None:
fragment = '.'
comps = glob.glob(fragment+'*') + glob.glob(fragment+'/*')
if len(comps) == 1 and os.path.isdir(comps[0]):
@@ -64,14 +64,14 @@ def assignees(bugdirs):
for bugdir in list(bugdirs.values()):
bugdir.load_all_bugs()
ret.update(set([bug.assigned for bug in bugdir
- if bug.assigned != None]))
+ if bug.assigned is not None]))
return list(ret)
def complete_assigned(command, argument, fragment=None):
return assignees(command._get_bugdirs())
def complete_extra_strings(command, argument, fragment=None):
- if fragment == None:
+ if fragment is None:
return []
return [fragment]
@@ -88,7 +88,7 @@ def complete_bug_comment_id(command, argument, fragment=None,
import libbe.bugdir
import libbe.util.id
bugdirs = command._get_bugdirs()
- if fragment == None or len(fragment) == 0:
+ if fragment is None or len(fragment) == 0:
fragment = '/'
try:
p = libbe.util.id.parse_user(bugdirs, fragment)
@@ -101,7 +101,7 @@ def complete_bug_comment_id(command, argument, fragment=None,
except libbe.util.id.NoIDMatches:
return []
except libbe.util.id.MultipleIDMatches as e:
- if e.common == None:
+ if e.common is None:
# choose among bugdirs
return e.matches
common = e.common
@@ -109,7 +109,7 @@ def complete_bug_comment_id(command, argument, fragment=None,
root,residual = libbe.util.id.residual(common, fragment)
p = libbe.util.id.parse_user(bugdirs, e.common)
bug = None
- if matches == None: # fragment was complete, get a list of children uuids
+ if matches is None: # fragment was complete, get a list of children uuids
if p['type'] == 'bugdir':
bugdir = bugdirs[p['bugdir']]
matches = bugdir.uuids()
@@ -131,11 +131,11 @@ def complete_bug_comment_id(command, argument, fragment=None,
if comments == False:
return[fragment]
bugdir = bugdirs[p['bugdir']]
- if bug == None:
+ if bug is None:
bug = bugdir.bug_from_uuid(p['bug'])
child_fn = bug.comment_from_uuid
elif p['type'] == 'comment':
- assert matches == None, matches
+ assert matches is None, matches
return [fragment]
possible = []
common += '/'
@@ -180,7 +180,7 @@ def select_values(string, possible_values, name="unkown"):
['abc', 'def', 'hij']
"""
possible_values = list(possible_values) # don't alter the original
- if string == None:
+ if string is None:
pass
elif string.startswith('-'):
blacklisted_values = set(string[1:].split(','))