Skip to content

Commit

Permalink
Update uidprocess.py
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Jul 17, 2023
1 parent a90d9b8 commit 5e228fa
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions htagweb/uidprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# https://github.com/manatlan/htag
# #############################################################################
import asyncio
import asyncio,sys
import multiprocessing
import logging,importlib
from htag.render import HRenderer
Expand Down Expand Up @@ -38,8 +38,16 @@ async def ht_create(self, fqn,js,init_params=None,renew=False): # -> str
#--------------------------- fqn -> module, name
names = fqn.split(".")
modulename,name=".".join(names[:-1]), names[-1]
module=importlib.import_module(modulename)
module=importlib.reload(module)
if modulename in sys.modules:
module=sys.modules[modulename]
try:
module=importlib.reload( module )
except ModuleNotFoundError:
""" can't be (really) reloaded if the component is in the
same module as the instance htag server"""
pass
else:
module=importlib.import_module(modulename)
#---------------------------
htClass = getattr(module,name)

Expand Down

0 comments on commit 5e228fa

Please sign in to comment.