Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise NotImplementedError("Can only add 1 asset at a time")
else:
refgenie_add(rgc, asset_list[0], args.path, args.force)
elif args.command == PULL_CMD:
rgc = RefGenConf(filepath=gencfg, writable=False)
if args.force:
force = True
elif args.no_overwrite:
force = False
else:
force = None
outdir = rgc[CFG_FOLDER_KEY]
if not os.path.exists(outdir):
raise MissingFolderError(outdir)
target = _key_to_name(CFG_FOLDER_KEY)
if not perm_check_x(outdir, target):
return
if not _single_folder_writeable(outdir):
_LOGGER.error("Insufficient permissions to write to {}: {}".
format(target, outdir))
return
for a in asset_list:
rgc.pull(a["genome"], a["asset"], a["tag"],
unpack=not args.no_untar, force=force)
elif args.command in [LIST_LOCAL_CMD, LIST_REMOTE_CMD]:
rgc = RefGenConf(filepath=gencfg, writable=False)
if args.command == LIST_REMOTE_CMD:
num_servers = 0
def __init__(self, folder):
"""
Create the error message.
:param str folder: path attempted to be used as folder to save a file to
"""
super(MissingFolderError, self).__init__(folder)
def _writeable(outdir, strict_exists=False):
outdir = outdir or "."
if os.path.exists(outdir):
return _single_folder_writeable(outdir)
elif strict_exists:
raise MissingFolderError(outdir)
return _writeable(os.path.dirname(outdir), strict_exists)