Skip to content

Commit

Permalink
Release 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lo5 committed Aug 11, 2020
1 parent 1f39341 commit 6161bf2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 29 deletions.
25 changes: 12 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ <h1 class="title">Package <code>h2o_q</code></h1>
realtime state synchronization between Python and web browsers.</p>
<h1 id="change-log">Change Log</h1>
<ul>
<li><a href="https:/h2oai/qd/releases/tag/v0.1.3">v0.1.3</a> - Aug 10, 2020<ul>
<li>Fixed<ul>
<li><code><a title="h2o_q.ui.link" href="ui.html#h2o_q.ui.link">link()</a></code> now has a <code>download</code> attribute to work around a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=858538">Firefox bug</a>.</li>
<li>Race condition in the interactive tour that caused some examples to not preview properly.</li>
</ul>
</li>
</ul>
</li>
<li><a href="https:/h2oai/qd/releases/tag/v0.1.2">v0.1.2</a> - Aug 7, 2020<ul>
<li>Added<ul>
<li>API for <code><a title="h2o_q.core.Expando" href="core.html#h2o_q.core.Expando">Expando</a></code> copy, clone and item/attribute deletion.</li>
Expand Down Expand Up @@ -4139,33 +4147,24 @@ <h2 id="uploads-ui_1">Uploads / UI</h2>
import os.path
from h2o_q import Q, listen, ui


def make_link_list(links_and_sizes):
# Make a markdown list of links.
return '\n'.join([f'- [{os.path.basename(link)} ({size} bytes)]({link})' for link, size in links_and_sizes])


async def main(q: Q):
links = q.args.user_files
if links:
links_and_sizes = []
items = [ui.text_xl('Files uploaded!')]
for link in links:
local_path = await q.site.download(link, '.')
#
# The file is now available locally; process the file.
# To keep this example simple, we just read the file size.
#
size = os.path.getsize(local_path)
links_and_sizes.append((link, size))

items.append(ui.link(label=f'{os.path.basename(link)} ({size} bytes)', download=True, path=link))
# Clean up
os.remove(local_path)

q.page['example'].items = [
ui.text_xl('Files uploaded!'),
ui.text(make_link_list(links_and_sizes)),
ui.button(name='back', label='Back', primary=True),
]
items.append(ui.button(name='back', label='Back', primary=True))
q.page['example'].items = items
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
ui.text_xl('Upload some files'),
Expand Down
37 changes: 30 additions & 7 deletions docs/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,7 @@ <h1 class="title">Module <code>h2o_q.types</code></h1>
label: Optional[str] = None,
path: Optional[str] = None,
disabled: Optional[bool] = None,
download: Optional[bool] = None,
button: Optional[bool] = None,
tooltip: Optional[str] = None,
):
Expand All @@ -2045,9 +2046,11 @@ <h1 class="title">Module <code>h2o_q.types</code></h1>
self.path = path
&#34;&#34;&#34;The path or URL to link to.&#34;&#34;&#34;
self.disabled = disabled
&#34;&#34;&#34;True if the link should be disable.&#34;&#34;&#34;
&#34;&#34;&#34;True if the link should be disabled.&#34;&#34;&#34;
self.download = download
&#34;&#34;&#34;True if the link should be used for file download.&#34;&#34;&#34;
self.button = button
&#34;&#34;&#34;True if the link should be rendered as a button&#34;&#34;&#34;
&#34;&#34;&#34;True if the link should be rendered as a button.&#34;&#34;&#34;
self.tooltip = tooltip
&#34;&#34;&#34;An optional tooltip message displayed when a user clicks the help icon to the right of the component.&#34;&#34;&#34;

Expand All @@ -2057,6 +2060,7 @@ <h1 class="title">Module <code>h2o_q.types</code></h1>
label=self.label,
path=self.path,
disabled=self.disabled,
download=self.download,
button=self.button,
tooltip=self.tooltip,
)
Expand All @@ -2067,17 +2071,20 @@ <h1 class="title">Module <code>h2o_q.types</code></h1>
__d_label: Any = __d.get(&#39;label&#39;)
__d_path: Any = __d.get(&#39;path&#39;)
__d_disabled: Any = __d.get(&#39;disabled&#39;)
__d_download: Any = __d.get(&#39;download&#39;)
__d_button: Any = __d.get(&#39;button&#39;)
__d_tooltip: Any = __d.get(&#39;tooltip&#39;)
label: Optional[str] = __d_label
path: Optional[str] = __d_path
disabled: Optional[bool] = __d_disabled
download: Optional[bool] = __d_download
button: Optional[bool] = __d_button
tooltip: Optional[str] = __d_tooltip
return Link(
label,
path,
disabled,
download,
button,
tooltip,
)
Expand Down Expand Up @@ -10139,7 +10146,7 @@ <h3>Methods</h3>
</dd>
<dt id="h2o_q.types.Link"><code class="flex name class">
<span>class <span class="ident">Link</span></span>
<span>(</span><span>label: Union[str, NoneType] = None, path: Union[str, NoneType] = None, disabled: Union[bool, NoneType] = None, button: Union[bool, NoneType] = None, tooltip: Union[str, NoneType] = None)</span>
<span>(</span><span>label: Union[str, NoneType] = None, path: Union[str, NoneType] = None, disabled: Union[bool, NoneType] = None, download: Union[bool, NoneType] = None, button: Union[bool, NoneType] = None, tooltip: Union[str, NoneType] = None)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a hyperlink.</p>
Expand All @@ -10162,6 +10169,7 @@ <h3>Methods</h3>
label: Optional[str] = None,
path: Optional[str] = None,
disabled: Optional[bool] = None,
download: Optional[bool] = None,
button: Optional[bool] = None,
tooltip: Optional[str] = None,
):
Expand All @@ -10170,9 +10178,11 @@ <h3>Methods</h3>
self.path = path
&#34;&#34;&#34;The path or URL to link to.&#34;&#34;&#34;
self.disabled = disabled
&#34;&#34;&#34;True if the link should be disable.&#34;&#34;&#34;
&#34;&#34;&#34;True if the link should be disabled.&#34;&#34;&#34;
self.download = download
&#34;&#34;&#34;True if the link should be used for file download.&#34;&#34;&#34;
self.button = button
&#34;&#34;&#34;True if the link should be rendered as a button&#34;&#34;&#34;
&#34;&#34;&#34;True if the link should be rendered as a button.&#34;&#34;&#34;
self.tooltip = tooltip
&#34;&#34;&#34;An optional tooltip message displayed when a user clicks the help icon to the right of the component.&#34;&#34;&#34;

Expand All @@ -10182,6 +10192,7 @@ <h3>Methods</h3>
label=self.label,
path=self.path,
disabled=self.disabled,
download=self.download,
button=self.button,
tooltip=self.tooltip,
)
Expand All @@ -10192,17 +10203,20 @@ <h3>Methods</h3>
__d_label: Any = __d.get(&#39;label&#39;)
__d_path: Any = __d.get(&#39;path&#39;)
__d_disabled: Any = __d.get(&#39;disabled&#39;)
__d_download: Any = __d.get(&#39;download&#39;)
__d_button: Any = __d.get(&#39;button&#39;)
__d_tooltip: Any = __d.get(&#39;tooltip&#39;)
label: Optional[str] = __d_label
path: Optional[str] = __d_path
disabled: Optional[bool] = __d_disabled
download: Optional[bool] = __d_download
button: Optional[bool] = __d_button
tooltip: Optional[str] = __d_tooltip
return Link(
label,
path,
disabled,
download,
button,
tooltip,
)</code></pre>
Expand All @@ -10224,17 +10238,20 @@ <h3>Static methods</h3>
__d_label: Any = __d.get(&#39;label&#39;)
__d_path: Any = __d.get(&#39;path&#39;)
__d_disabled: Any = __d.get(&#39;disabled&#39;)
__d_download: Any = __d.get(&#39;download&#39;)
__d_button: Any = __d.get(&#39;button&#39;)
__d_tooltip: Any = __d.get(&#39;tooltip&#39;)
label: Optional[str] = __d_label
path: Optional[str] = __d_path
disabled: Optional[bool] = __d_disabled
download: Optional[bool] = __d_download
button: Optional[bool] = __d_button
tooltip: Optional[str] = __d_tooltip
return Link(
label,
path,
disabled,
download,
button,
tooltip,
)</code></pre>
Expand All @@ -10245,11 +10262,15 @@ <h3>Instance variables</h3>
<dl>
<dt id="h2o_q.types.Link.button"><code class="name">var <span class="ident">button</span></code></dt>
<dd>
<div class="desc"><p>True if the link should be rendered as a button</p></div>
<div class="desc"><p>True if the link should be rendered as a button.</p></div>
</dd>
<dt id="h2o_q.types.Link.disabled"><code class="name">var <span class="ident">disabled</span></code></dt>
<dd>
<div class="desc"><p>True if the link should be disable.</p></div>
<div class="desc"><p>True if the link should be disabled.</p></div>
</dd>
<dt id="h2o_q.types.Link.download"><code class="name">var <span class="ident">download</span></code></dt>
<dd>
<div class="desc"><p>True if the link should be used for file download.</p></div>
</dd>
<dt id="h2o_q.types.Link.label"><code class="name">var <span class="ident">label</span></code></dt>
<dd>
Expand Down Expand Up @@ -10281,6 +10302,7 @@ <h3>Methods</h3>
label=self.label,
path=self.path,
disabled=self.disabled,
download=self.download,
button=self.button,
tooltip=self.tooltip,
)</code></pre>
Expand Down Expand Up @@ -18485,6 +18507,7 @@ <h4><code><a title="h2o_q.types.Link" href="#h2o_q.types.Link">Link</a></code></
<ul class="two-column">
<li><code><a title="h2o_q.types.Link.button" href="#h2o_q.types.Link.button">button</a></code></li>
<li><code><a title="h2o_q.types.Link.disabled" href="#h2o_q.types.Link.disabled">disabled</a></code></li>
<li><code><a title="h2o_q.types.Link.download" href="#h2o_q.types.Link.download">download</a></code></li>
<li><code><a title="h2o_q.types.Link.dump" href="#h2o_q.types.Link.dump">dump</a></code></li>
<li><code><a title="h2o_q.types.Link.label" href="#h2o_q.types.Link.label">label</a></code></li>
<li><code><a title="h2o_q.types.Link.load" href="#h2o_q.types.Link.load">load</a></code></li>
Expand Down
22 changes: 15 additions & 7 deletions docs/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ <h1 class="title">Module <code>h2o_q.ui</code></h1>
label: Optional[str] = None,
path: Optional[str] = None,
disabled: Optional[bool] = None,
download: Optional[bool] = None,
button: Optional[bool] = None,
tooltip: Optional[str] = None,
) -&gt; Component:
Expand All @@ -1068,8 +1069,9 @@ <h1 class="title">Module <code>h2o_q.ui</code></h1>
Args:
label: The text to be displayed. If blank, the `path` is used as the label.
path: The path or URL to link to.
disabled: True if the link should be disable.
button: True if the link should be rendered as a button
disabled: True if the link should be disabled.
download: True if the link should be used for file download.
button: True if the link should be rendered as a button.
tooltip: An optional tooltip message displayed when a user clicks the help icon to the right of the component.
Returns:
A `h2o_q.types.Link` instance.
Expand All @@ -1078,6 +1080,7 @@ <h1 class="title">Module <code>h2o_q.ui</code></h1>
label,
path,
disabled,
download,
button,
tooltip,
))
Expand Down Expand Up @@ -4054,7 +4057,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="h2o_q.ui.link"><code class="name flex">
<span>def <span class="ident">link</span></span>(<span>label: Union[str, NoneType] = None, path: Union[str, NoneType] = None, disabled: Union[bool, NoneType] = None, button: Union[bool, NoneType] = None, tooltip: Union[str, NoneType] = None) ‑> <a title="h2o_q.types.Component" href="types.html#h2o_q.types.Component">Component</a></span>
<span>def <span class="ident">link</span></span>(<span>label: Union[str, NoneType] = None, path: Union[str, NoneType] = None, disabled: Union[bool, NoneType] = None, download: Union[bool, NoneType] = None, button: Union[bool, NoneType] = None, tooltip: Union[str, NoneType] = None) ‑> <a title="h2o_q.types.Component" href="types.html#h2o_q.types.Component">Component</a></span>
</code></dt>
<dd>
<div class="desc"><p>Create a hyperlink.</p>
Expand All @@ -4068,9 +4071,11 @@ <h2 id="args">Args</h2>
<dt><strong><code>path</code></strong></dt>
<dd>The path or URL to link to.</dd>
<dt><strong><code>disabled</code></strong></dt>
<dd>True if the link should be disable.</dd>
<dd>True if the link should be disabled.</dd>
<dt><strong><code>download</code></strong></dt>
<dd>True if the link should be used for file download.</dd>
<dt><strong><code>button</code></strong></dt>
<dd>True if the link should be rendered as a button</dd>
<dd>True if the link should be rendered as a button.</dd>
<dt><strong><code>tooltip</code></strong></dt>
<dd>An optional tooltip message displayed when a user clicks the help icon to the right of the component.</dd>
</dl>
Expand All @@ -4084,6 +4089,7 @@ <h2 id="returns">Returns</h2>
label: Optional[str] = None,
path: Optional[str] = None,
disabled: Optional[bool] = None,
download: Optional[bool] = None,
button: Optional[bool] = None,
tooltip: Optional[str] = None,
) -&gt; Component:
Expand All @@ -4096,8 +4102,9 @@ <h2 id="returns">Returns</h2>
Args:
label: The text to be displayed. If blank, the `path` is used as the label.
path: The path or URL to link to.
disabled: True if the link should be disable.
button: True if the link should be rendered as a button
disabled: True if the link should be disabled.
download: True if the link should be used for file download.
button: True if the link should be rendered as a button.
tooltip: An optional tooltip message displayed when a user clicks the help icon to the right of the component.
Returns:
A `h2o_q.types.Link` instance.
Expand All @@ -4106,6 +4113,7 @@ <h2 id="returns">Returns</h2>
label,
path,
disabled,
download,
button,
tooltip,
))</code></pre>
Expand Down
4 changes: 4 additions & 0 deletions py/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Change Log

- [v0.1.3](https:/h2oai/qd/releases/tag/v0.1.3) - Aug 10, 2020
- Fixed
- `h2o_q.ui.link()` now has a `download` attribute to work around a [Firefox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=858538).
- Race condition in the interactive tour that caused some examples to not preview properly.
- [v0.1.2](https:/h2oai/qd/releases/tag/v0.1.2) - Aug 7, 2020
- Added
- API for `h2o_q.core.Expando` copy, clone and item/attribute deletion.
Expand Down
2 changes: 1 addition & 1 deletion py/examples/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ bokeh
matplotlib
altair
vega-datasets
h2o_q==0.1.2
h2o_q==0.1.3
2 changes: 1 addition & 1 deletion py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='h2o_q',
version='0.1.2',
version='0.1.3',
author='Prithvi Prabhu',
author_email='[email protected]',
description='Python driver for H2O Q Realtime Apps',
Expand Down

0 comments on commit 6161bf2

Please sign in to comment.