Skip to content

Commit

Permalink
Add msg argument to done()
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmilano committed Jan 29, 2021
1 parent 2226eb4 commit 7513dd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
9 changes: 1 addition & 8 deletions examples/temperature-converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ def convert(self, vals):
v = self.map_vals(vals)
if not v['_fahrenheit']:
raise ValueError('Enter a temperature')
response = {
'action': 'CALLBACK',
'function': 'showCelsius',
'params': {
'celsius': fahrenheit_to_celsius(v['_fahrenheit'])
}
}
return response
return Viaduc.callback('showCelsius', {'celsius': fahrenheit_to_celsius(v['_fahrenheit'])})


class Presentation(Viaduc.Presentation):
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[metadata]
name = viaduc
version = 1.0.4
version = 1.0.5
description = probably the simplest way to create a nice-looking gui using python
long_description_content_type = text/markdown
long_description =
Viaduc is probably the simplest way to create a nice-looking gui using python and tiny bit of html/css/js.

![form example](https://github.com/dtmilano/viaduc/blob/main/screenshots/form.png)
![form example](https://raw.githubusercontent.com/dtmilano/viaduc/main/screenshots/form.png)

viaduc uses pywebview and [Bootstrap](https://getbootstrap.com/) to provide a gui for other tools and scripts.
keywords = gui, ui, webview, pywebview, tkinter
Expand Down
8 changes: 5 additions & 3 deletions viaduc/viaduc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@author: Diego Torres Milano
"""

__version__ = '1.0.4'
__version__ = '1.0.5'

import argparse as argparse
import re
Expand Down Expand Up @@ -319,6 +319,7 @@ class Viaduc:
"""
Viaduc: simplest python gui.
"""

class Api:
window: webview.window = None

Expand Down Expand Up @@ -435,9 +436,10 @@ def on_top(self, value):
self.window.on_top = value

@staticmethod
def done():
def done(msg=None):
return {
'action': 'DONE'
'action': 'DONE',
'message': msg
}

@staticmethod
Expand Down

0 comments on commit 7513dd0

Please sign in to comment.