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 support for Documents Portal #210

Merged
merged 6 commits into from
Feb 15, 2019
Merged

CLI support for Documents Portal #210

merged 6 commits into from
Feb 15, 2019

Conversation

polyatail
Copy link
Contributor

This PR addresses the following issues, related to the new documents portal:

@polyatail polyatail added the needs review need code review before merging label Feb 13, 2019
@polyatail polyatail added this to the Sprint Maize milestone Feb 13, 2019
@polyatail polyatail self-assigned this Feb 13, 2019
@polyatail polyatail requested review from audy and boydgreenfield and removed request for boydgreenfield February 13, 2019 01:24
onecodex/cli.py Outdated

if not doc_obj:
log.error('Could not find document {} (404 status code)'.format(file))
return
Copy link
Contributor

Choose a reason for hiding this comment

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

replace with quit(-1) so scripts wrapping this executable will know something went wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

(or however you have to exit so that Sentry still records something)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

-------
`list` of `string`s containing document UUIDs of newly uploaded files.
"""
if threads is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

default to threads=1 in function definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh this is leftover from when we were using DEFAULT_UPLOAD_THREADS.

# handle inside the thread to prevent the exception message from leaking out
wrapped_args[-1].value = '{}'.format(e)

if log:
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this pattern being used a lot. When is log not defined? I noticed that it's often defined at the top of modules making it global so that you don't have to put if log everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's available when these methods (which are on the document models) are executed from, e.g., within a jupyter notebook.

if path is None:
path = os.path.join(os.getcwd(), self.filename)

if os.path.exists(path):
Copy link
Contributor

Choose a reason for hiding this comment

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

check if not /dev/stdout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@polyatail polyatail added done ready to be merged and removed needs review need code review before merging labels Feb 15, 2019
@polyatail polyatail merged commit 636c77e into master Feb 15, 2019
@coveralls
Copy link

coveralls commented Feb 16, 2019

Coverage Status

Coverage decreased (-1.2%) to 84.783% when pulling 9a3a4d1 on roo-documents into 7e63650 on master.

@polyatail polyatail deleted the roo-documents branch March 7, 2019 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants