-
Notifications
You must be signed in to change notification settings - Fork 97
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
Timmermans Pieter
committed
Sep 6, 2022
1 parent
c7d9fe8
commit 1a24f85
Showing
76 changed files
with
8,404 additions
and
3,454 deletions.
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import justpy as jp | ||
|
||
|
||
def hello_world(): | ||
wp = jp.WebPage() | ||
jp.Hello(a=wp) | ||
return wp | ||
|
||
jp.justpy(hello_world) | ||
|
||
jp.justpy(hello_world) |
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
''' | ||
""" | ||
Created on 2022-09-07 | ||
@author: wf | ||
''' | ||
""" | ||
import argparse | ||
import socket | ||
import typing | ||
|
||
|
||
class Demo(object): | ||
''' | ||
""" | ||
Base class for justpy demos to allow selecting host and port from commandline | ||
''' | ||
testmode=False | ||
""" | ||
|
||
testmode = False | ||
|
||
def __init__(self, name:str,wp:typing.Callable,**kwargs): | ||
''' | ||
def __init__(self, name: str, wp: typing.Callable, **kwargs): | ||
""" | ||
Constructor | ||
Args: | ||
name(str): the name of the demo | ||
host(int): the port to runt he demo at (defaut:8000) | ||
wp(callable): the webpage callback | ||
**kwargs: further keyword arguments | ||
''' | ||
""" | ||
# make sure Demo code may be tested without automatically starting | ||
if Demo.testmode: | ||
return | ||
parser = argparse.ArgumentParser(description=name) | ||
parser.add_argument('--host',default=socket.getfqdn()) | ||
parser.add_argument('--port',type=int,default=8000) | ||
parser.add_argument("--host", default=socket.getfqdn()) | ||
parser.add_argument("--port", type=int, default=8000) | ||
args = parser.parse_args() | ||
import justpy as jp | ||
jp.justpy(wp,host=args.host,port=args.port,**kwargs) | ||
|
||
jp.justpy(wp, host=args.host, port=args.port, **kwargs) |
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
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
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
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
Oops, something went wrong.