aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/target.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-03-30 22:16:37 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-03-30 22:16:37 +0100
commit6669d427f87ec62a86a680a542d2f87f2d65cc80 (patch)
tree80e08e1830eb6283fffa2d3db600ad00090d1970 /libbe/command/target.py
parentbc53c496220b283773f65762d4283c8f1e480131 (diff)
downloadbugseverywhere-6669d427f87ec62a86a680a542d2f87f2d65cc80.tar.gz
Used PyCharms inspectors.
Diffstat (limited to 'libbe/command/target.py')
-rw-r--r--libbe/command/target.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/libbe/command/target.py b/libbe/command/target.py
index b13647e..eb11c11 100644
--- a/libbe/command/target.py
+++ b/libbe/command/target.py
@@ -90,10 +90,10 @@ class Target (libbe.command.Command):
def _run(self, **params):
if params['resolve'] == False:
- if params['id'] == None:
+ if params['id'] is None:
raise libbe.command.UserError('Please specify a bug id.')
else:
- if params['target'] != None:
+ if params['target'] is not None:
raise libbe.command.UserError('Too many arguments')
params['target'] = params.pop('id')
bugdirs = self._get_bugdirs()
@@ -106,7 +106,7 @@ class Target (libbe.command.Command):
raise libbe.command.UserError(
'Ambiguous bugdir {}'.format(sorted(bugdirs.values())))
bug = bug_from_target_summary(bugdirs, bugdir, params['target'])
- if bug == None:
+ if bug is None:
print('No target assigned.', file=self.stdout)
else:
print(bug.id.long_user(), file=self.stdout)
@@ -114,9 +114,9 @@ class Target (libbe.command.Command):
bugdir,bug,comment = (
libbe.command.util.bugdir_bug_comment_from_user_id(
bugdirs, params['id']))
- if params['target'] == None:
+ if params['target'] is None:
target = bug_target(bugdirs, bug)
- if target == None:
+ if target is None:
print('No target assigned.', file=self.stdout)
else:
print(target.summary, file=self.stdout)
@@ -157,8 +157,8 @@ by UUID), try
"""
def bug_from_target_summary(bugdirs, bugdir, summary=None):
- if summary == None:
- if bugdir.target == None:
+ if summary is None:
+ if bugdir.target is None:
return None
else:
return bugdir.bug_from_uuid(bugdir.target)
@@ -196,7 +196,7 @@ def remove_target(bugdirs, bug):
def add_target(bugdirs, bugdir, bug, summary):
target = bug_from_target_summary(bugdirs, bugdir, summary)
- if target == None:
+ if target is None:
target = bugdir.new_bug(summary=summary)
target.severity = 'target'
libbe.command.depend.add_block(target, bug)