| 1 |
import webview |
| 2 |
|
| 3 |
""" |
| 4 |
An example of serverless app architecture |
| 5 |
""" |
| 6 |
|
| 7 |
|
| 8 |
class Api: |
| 9 |
def addItem(self, title): |
| 10 |
print(f'Added item {title}') |
| 11 |
|
| 12 |
def removeItem(self, item): |
| 13 |
print(f'Removed item {item}') |
| 14 |
|
| 15 |
def editItem(self, item): |
| 16 |
print(f'Edited item {item}') |
| 17 |
|
| 18 |
def toggleItem(self, item): |
| 19 |
print(f'Toggled item {item}') |
| 20 |
|
| 21 |
def toggleFullscreen(self): |
| 22 |
webview.windows[0].toggle_fullscreen() |
| 23 |
|
| 24 |
|
| 25 |
if __name__ == '__main__': |
| 26 |
api = Api() |
| 27 |
webview.create_window('Todos magnificos', 'assets/index.html', js_api=api, min_size=(600, 450)) |
| 28 |
webview.start(ssl=True) |