-
Notifications
You must be signed in to change notification settings - Fork 79
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
Plugin install gui #1966
Plugin install gui #1966
Conversation
Changes Unknown when pulling 9baf425 on josenavas:plugin-install-gui into * on biocore:plugin-installation*. |
…into plugin-install-gui
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.
1 question.
except qdb.exceptions.QiitaDBDuplicateError as e: | ||
raise HTTPError(400, str(e)) | ||
except qdb.exceptions.QiitaDBDuplicateError: | ||
pass |
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.
Could you comment why this change?
Changes Unknown when pulling a2ecb01 on josenavas:plugin-install-gui into * on biocore:plugin-installation*. |
Changes Unknown when pulling a2ecb01 on josenavas:plugin-install-gui into * on biocore:plugin-installation*. |
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.
This looks great, just a few minor questions.
except qdb.exceptions.QiitaDBDuplicateError: | ||
# Ignoring this error as we want this endpoint in the rest api | ||
# to be idempotent. | ||
pass |
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 think you can also set the _reason
to the response so that there's a difference between it already exists and everything went fine. Not blocking though. http://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.set_status
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.
Done
"""Returns the commands that can process the given artifact types | ||
|
||
Parameters | ||
---------- | ||
artifact_type : list of str | ||
The artifact types | ||
active_only : bool |
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.
bool, optional
.
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.
Done
WHERE artifact_type IN %s""" | ||
if active_only: | ||
sql = "%s AND active = True" % sql |
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 almost thought there was a bug in there, was expecting something like sql += ' AND active = True'
.
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.
Done
for s in qdb.software.Software.iter_active(): | ||
s.register_commands() | ||
|
||
ioloop.add_timeout(time() + 0.5, callback_function) |
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.
Maybe more convenient to use tornado's time? http://www.tornadoweb.org/en/stable/ioloop.html#tornado.ioloop.IOLoop.time
Not suer if it is available in the version of tornado we are using.
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.
Done
Changes Unknown when pulling 6671707 on josenavas:plugin-install-gui into * on biocore:plugin-installation*. |
Thanks @josenavas |
Changes Unknown when pulling 6671707 on josenavas:plugin-install-gui into * on biocore:plugin-installation*. |
Depends on #1965 so review/merge that one first.
Modifies the command retrieval to retrieve only active commands (this way only active commands are shown in the GUI).
Makes sure that when Qiita starts, the plugins are called so they register their commands.
The call to create types need to be idempotent, instead of failing. So I changed it here.