-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Josh H
committed
Sep 8, 2018
1 parent
0bbd193
commit e3967ef
Showing
4 changed files
with
234 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "58c9cacec7ea499ab58c5af925888677", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/html": [ | ||
"<p>Failed to display Jupyter Widget of type <code>Button</code>.</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", | ||
" that the widgets JavaScript is still loading. If this message persists, it\n", | ||
" likely means that the widgets JavaScript library is either not installed or\n", | ||
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", | ||
" Widgets Documentation</a> for setup instructions.\n", | ||
"</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in another frontend (for example, a static\n", | ||
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", | ||
" it may mean that your frontend doesn't currently support widgets.\n", | ||
"</p>\n" | ||
], | ||
"text/plain": [ | ||
"Button(description='Request Help', style=ButtonStyle())" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "dfbbd99b4aba487ab8dc2d329adb3c40", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/html": [ | ||
"<p>Failed to display Jupyter Widget of type <code>Button</code>.</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", | ||
" that the widgets JavaScript is still loading. If this message persists, it\n", | ||
" likely means that the widgets JavaScript library is either not installed or\n", | ||
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", | ||
" Widgets Documentation</a> for setup instructions.\n", | ||
"</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in another frontend (for example, a static\n", | ||
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", | ||
" it may mean that your frontend doesn't currently support widgets.\n", | ||
"</p>\n" | ||
], | ||
"text/plain": [ | ||
"Button(description='Request Checkoff', style=ButtonStyle())" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"from client import connect_to_queue\n", | ||
"\n", | ||
"first_name = 'Ben'\n", | ||
"last_name = 'Bitdiddle'\n", | ||
"kerberos = 'bitdid'\n", | ||
"\n", | ||
"connect_to_queue(first_name, last_name, kerberos)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import requests | ||
from ipywidgets import widgets | ||
from IPython.display import display | ||
|
||
def connect_to_queue(first_name, last_name, kerberos, base_url="http://127.0.0.1:5000/"): | ||
help_button = widgets.Button(description="Request Help") | ||
checkoff_button = widgets.Button(description="Request Checkoff") | ||
|
||
display(help_button) | ||
display(checkoff_button) | ||
|
||
params = {"first_name": first_name, "last_name": last_name, "kerberos": kerberos} | ||
|
||
def make_help_request(a): | ||
r = requests.post(base_url+'queue/help', data=params) | ||
|
||
def make_checkoff_request(a): | ||
r = requests.post(base_url+'queue/checkoff', data=params) | ||
|
||
help_button.on_click(make_help_request) | ||
checkoff_button.on_click(make_checkoff_request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "62b9d53c410e47029bd6595e8ea94401", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/html": [ | ||
"<p>Failed to display Jupyter Widget of type <code>Button</code>.</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", | ||
" that the widgets JavaScript is still loading. If this message persists, it\n", | ||
" likely means that the widgets JavaScript library is either not installed or\n", | ||
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", | ||
" Widgets Documentation</a> for setup instructions.\n", | ||
"</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in another frontend (for example, a static\n", | ||
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", | ||
" it may mean that your frontend doesn't currently support widgets.\n", | ||
"</p>\n" | ||
], | ||
"text/plain": [ | ||
"Button(description='Request Help', style=ButtonStyle())" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "6a30eb27d09045c98a3370d2f4a25ce9", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/html": [ | ||
"<p>Failed to display Jupyter Widget of type <code>Button</code>.</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", | ||
" that the widgets JavaScript is still loading. If this message persists, it\n", | ||
" likely means that the widgets JavaScript library is either not installed or\n", | ||
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", | ||
" Widgets Documentation</a> for setup instructions.\n", | ||
"</p>\n", | ||
"<p>\n", | ||
" If you're reading this message in another frontend (for example, a static\n", | ||
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", | ||
" it may mean that your frontend doesn't currently support widgets.\n", | ||
"</p>\n" | ||
], | ||
"text/plain": [ | ||
"Button(description='Request Checkoff', style=ButtonStyle())" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"from client import connect_to_queue\n", | ||
"\n", | ||
"first_name = 'Ben'\n", | ||
"last_name = 'Bitdiddle'\n", | ||
"kerberos = 'bitdid'\n", | ||
"\n", | ||
"connect_to_queue(first_name, last_name, kerberos)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters