Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: sets default notebook to jupyter #344

Merged
merged 2 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
100 changes: 51 additions & 49 deletions reana_client/cli/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,55 +244,57 @@ def upload_files(ctx, workflow, filenames, access_token): # noqa: D301
get('directories') or []]

if workflow:
for filename in filenames:
try:
response = upload_to_server(workflow,
filename,
access_token)
for file_ in response:
if file_.startswith('symlink:'):
click.echo(
click.style('Symlink resolved to {}. Uploaded'
' hard copy.'.
format(file_[len('symlink:'):]),
fg='green'))
else:
click.echo(
click.style('File {} was successfully uploaded.'.
format(file_), fg='green'))
except FileNotFoundError as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'File {0} could not be uploaded: {0} does not exist.'.
format(filename),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)
except FileUploadError as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'Something went wrong while uploading {0}.\n{1}'.
format(filename, str(e)),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)
except Exception as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'Something went wrong while uploading {}'.
format(filename),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)
if filenames:
for filename in filenames:
try:
response = upload_to_server(workflow,
filename,
access_token)
for file_ in response:
if file_.startswith('symlink:'):
click.echo(
click.style('Symlink resolved to {}. Uploaded'
' hard copy.'.
format(file_[len('symlink:'):]),
fg='green'))
else:
click.echo(
click.style('File {} was successfully '
'uploaded.'.format(file_),
fg='green'))
except FileNotFoundError as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'File {0} could not be uploaded: {0} does not'
' exist.'.format(filename),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)
except FileUploadError as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'Something went wrong while uploading {0}.\n{1}'.
format(filename, str(e)),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)
except Exception as e:
logging.debug(traceback.format_exc())
logging.debug(str(e))
click.echo(
click.style(
'Something went wrong while uploading {}'.
format(filename),
fg='red'),
err=True)
if 'invoked_by_subcommand' in ctx.parent.__dict__:
sys.exit(1)


@files_group.command('rm')
Expand Down
1 change: 1 addition & 0 deletions reana_client/cli/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ def interactive_group():
@click.argument(
'interactive-session-type',
metavar='interactive-session-type',
default=INTERACTIVE_SESSION_TYPES[0],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since close closes jupyter, but default, I guess we can go with it, but there might be changes ahead later.

type=click.Choice(INTERACTIVE_SESSION_TYPES))
@click.option(
'-i',
Expand Down