Skip to content

Commit

Permalink
compat new fqn
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Jul 23, 2023
1 parent 2c84cec commit 6b6c80e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ async def handlePath(request):
h=f"""
{os.getpid()}
<li><a href="/a1">a1</a> : app without session
<li><a href="/a12">a12</a> : app without session
<li><a href="/a2">a2</a> : app with session (not renewed)
<li><a href="/a22">a22</a> : app with session (renewed at each refresh)
<li><a href="/k1">k1</a> : App with bug in init
Expand All @@ -27,6 +28,8 @@ async def handlePath(request):
return HTMLResponse(h)
elif p=="a1":
return await app.serve(request, "app1.App")
elif p=="a12":
return await app.serve(request, "app1:App")
elif p=="a2":
return await app.serve(request, app2.App )
elif p=="a22":
Expand Down
2 changes: 1 addition & 1 deletion htagweb/webbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def send_wrapper(message: Message) -> None:

def findfqn(x) -> str:
if isinstance(x,str):
if "." not in x:
if ("." not in x) and (":" not in x):
raise Exception(f"'{x}' is not a 'full qualified name' (expected 'module.name') of an App (htag.Tag class)")
return x # /!\ x is a fqn /!\ DANGEROUS /!\
elif isinstance(x, ModuleType):
Expand Down

0 comments on commit 6b6c80e

Please sign in to comment.