Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CRISPResso2/CRISPRessoShared.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def overwrite_crispresso_options(cmd, option_names_to_overwrite, option_values,
if option:
if option in option_values:
if paramInd is None:
if type(option_values) == dict:
if type(option_values) is dict:
val = option_values[option]
else:
val = getattr(option_values, option)
Expand Down Expand Up @@ -305,18 +305,18 @@ def overwrite_crispresso_options(cmd, option_names_to_overwrite, option_values,
if action.nargs == 0:
if val: # if value is true
new_cmd += ' --%s' % action.dest
elif action.type == bool: # but just in case...
elif action.type is bool: # but just in case...
if val:
new_cmd += ' --%s' % action.dest
elif action.type == str:
elif action.type is str:
if val != "":
if re.fullmatch(r"[a-zA-Z0-9\._]*", val): # if the value is alphanumeric, don't have to quote it
new_cmd += ' --%s %s' % (action.dest, val)
elif val.startswith('"') and val.endswith('"'):
new_cmd += ' --%s %s' % (action.dest, val)
else:
new_cmd += ' --%s "%s"' % (action.dest, val)
elif action.type == int:
elif action.type is int:
new_cmd += ' --%s %s' % (action.dest, val)

return new_cmd
Expand Down Expand Up @@ -350,7 +350,7 @@ def propagate_crispresso_options(cmd, options, params, paramInd=None):
if option:
if option in params:
if paramInd is None:
if type(params) == dict:
if type(params) is dict:
val = params[option]
else:
val = getattr(params, option)
Expand Down