-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
onecodex/cli.py
Outdated
|
||
if not doc_obj: | ||
log.error('Could not find document {} (404 status code)'.format(file)) | ||
return |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
onecodex/lib/upload.py
Outdated
------- | ||
`list` of `string`s containing document UUIDs of newly uploaded files. | ||
""" | ||
if threads is None: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
onecodex/models/misc.py
Outdated
if path is None: | ||
path = os.path.join(os.getcwd(), self.filename) | ||
|
||
if os.path.exists(path): |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
f05aa4e
to
3f644c3
Compare
3f644c3
to
9a3a4d1
Compare
This PR addresses the following issues, related to the new documents portal:
OneCodexDocumentExporter
OneCodexHTMLExporter
nbconvert entry point for exporting reports as HTML, in addition to PDF