Skip to content

Commit

Permalink
fixes #567 regression and prepares release
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Oct 19, 2022
1 parent c80c11a commit 2c3dfc7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions examples/demo_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,15 @@ class DemoBrowser(BaseWebPage):
"""
Browser for demos
"""
def __init__(self):
def __init__(self,base_path:str=None):
"""
constructor
Args:
base_path(str): the path to search examples in
"""
BaseWebPage.__init__(self)
self.demo_starter=Demostarter()
self.demo_starter=Demostarter(base_path=base_path)
self.tutorial_manager=TutorialManager()
jp.app.add_jproute("/demo/{demo_name}",self.show_demo)
self.mounted={}
Expand Down Expand Up @@ -434,10 +437,17 @@ def main(argv=None): # IGNORE:C0111
parser.add_argument(
"-d", "--debug", dest="debug", action="store_true", help="show debug info"
)
script_dir = os.path.dirname(__file__)
parser.add_argument(
"-p",
"--path",
default=os.path.dirname(script_dir),
help="path to the examples (default: %(default)s)",
)
parser.add_argument("--host", default=socket.getfqdn())
parser.add_argument("--port", type=int, default=8000)
args = parser.parse_args(argv[1:])
demo_browser=DemoBrowser()
demo_browser=DemoBrowser(base_path=args.path)
jp.justpy(demo_browser.web_page,host=args.host, port=args.port,PLOTLY=True,KATEX=True,VEGA=True)
except Exception as e:
indent = len(program_name) * " "
Expand Down
2 changes: 1 addition & 1 deletion jpcore/demostarter.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def main(argv=None): # IGNORE:C0111
)

args = parser.parse_args(argv[1:])
demostarter = Demostarter(mode=args.mode, debug=args.debug)
demostarter = Demostarter(base_path=args.path,mode=args.mode, debug=args.debug)
if args.debug:
for demo in demostarter.demos:
print(demo)
Expand Down
2 changes: 1 addition & 1 deletion justpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""JustPy is an object-oriented, component based, high-level Python Web Framework that requires no front-end programming"""
from .justpy import *

__version__ = "0.9.6"
__version__ = "0.9.7"

0 comments on commit 2c3dfc7

Please sign in to comment.