Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cmd_fixby(args):
load_db()
if db.change_issue(args.issue, 'Fix_By', args.newfixby):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
def cmd_component(args):
load_db()
if db.change_issue(args.issue, 'Component', args.newcomponent):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
fulluser = ''
for row in config.users:
if args.newowner in row:
if fulluser != '':
print "Ambiguous user. Please be more specific"
return False
else:
fulluser = row
if fulluser == '':
print "Unknown user"
return False
if db.change_issue(args.issue, 'Owner', fulluser):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
def cmd_state(args):
load_db()
if db.change_issue(args.issue, 'State', args.newstate):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
def cmd_type(args):
load_db()
if db.change_issue(args.issue, 'Type', args.newtype):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
print 'Creating issue aborted'
os.unlink(config.db_path + 'new.tmp')
return True
issue = {}
issue = parse_file(config.db_path + 'new.tmp')
os.unlink(config.db_path + 'new.tmp')
load_db()
issue_filename, issue_hash = db.add_issue(issue)
db.save_issue_db()
print 'Created issue %s' % issue_hash
if not args.no_commit:
return config.vcs.commit()
else:
return True
def cmd_priority(args):
load_db()
if db.change_issue(args.issue, 'Priority', args.newpriority):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
def cmd_title(args):
load_db()
if db.change_issue(args.issue, 'Title', args.newtitle):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False
def cmd_state(args):
def cmd_severity(args):
load_db()
if db.change_issue(args.issue, 'Severity', args.newseverity):
if not args.no_commit:
return config.vcs.commit()
else:
return True
else:
return False