Skip to content

Commit

Permalink
Update tag.py
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Jan 26, 2024
1 parent fbabe8f commit ba8ecce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htag/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,14 @@ def _getAllJs(self) -> list:
ll=[]

# auto-declare js methods for exposed's python methods
autodeclares=[]
for method_name in set(dir(self)) - TAG_KEYWORDS:
if hasattr( getattr(self,method_name) ,"_autoExposeClientSide_"):
logger.debug("expose python method '%s' as js caller in %s",method_name,repr(self))
ll.append( "self.%s = function(_) {%s};" % (method_name,BaseCaller(self,method_name,[b"...arguments"],{})) )
autodeclares.append( "self.%s = function(_) {%s}" % (method_name,BaseCaller(self,method_name,[b"...arguments"],{})) )

if autodeclares:
ll.append( self._genIIFEScript( ";".join(autodeclares) ) ) #IIFE !

if self.js:
logger.debug("Init Script (.js) found in %s --> '%s'",repr(self),self.js)
Expand Down

0 comments on commit ba8ecce

Please sign in to comment.