Skip to content

Commit

Permalink
change the way the module is reloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Jul 16, 2023
1 parent 7d619a4 commit a90d9b8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions htagweb/uidprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ async def ht_create(self, fqn,js,init_params=None,renew=False): # -> str
session["ht_create"]="here"
if init_params is None : init_params=((),{})

#--------------------------- fqn -> module, name
names = fqn.split(".")
modulename,name=".".join(names[:-1]), names[-1]
module=importlib.import_module(modulename)
#---------------------------
htClass = getattr(module,name)

hr=HTS.get(fqn)
if renew or (hr is None) or str(init_params)!=str(hr.init):
##HRenderer(tagClass: type, js:str, exit_callback:Optional[Callable]=None, init= ((),{}), fullerror=False, statics=[], session=None ):

#--------------------------- fqn -> module, name
names = fqn.split(".")
modulename,name=".".join(names[:-1]), names[-1]
module=importlib.import_module(modulename)
module=importlib.reload(module)
#---------------------------
htClass = getattr(module,name)


hr=HRenderer( htClass,
js=js,
session=session,
Expand Down

0 comments on commit a90d9b8

Please sign in to comment.