Skip to content

Commit

Permalink
Fixed corner case to deal with loaded actions that replace actions in…
Browse files Browse the repository at this point in the history
… plumed with different syntax
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed May 10, 2024
1 parent 61e6521 commit 1ca8779
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion PlumedToHTML/PlumedFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ def format(self, tokensource, outfile):
for kkkk in self.keyword_dict[action]["syntax"] :
if kkkk=="output" or self.keyword_dict[action]["syntax"][kkkk]["multiple"]==0 : continue
if kkkk in value.strip() : foundkey, desc = True, self.keyword_dict[action]["syntax"][kkkk.upper()]["description"].split('.')[0]
if not self.broken and not notooltips and not foundkey : raise Exception("keyword " + value.strip().upper() + " is not in syntax for action " + action )
if not self.broken and not notooltips and not foundkey :
if self.hasload : foundkey, desc = True, 'There is a possibity that this action is not part of PLUMED and was included by using a LOAD command. This LOADing replaces one of the actions that is in PLUMED. You should thus be wary of the documentation in these tooltips and look at the cpp file that was loaded <a href="' + self.keyword_dict["LOAD"]["hyperlink"] + '" style="color:green">More details</a><i></i></div></div>'
else : raise Exception("keyword " + value.strip().upper() + " is not in syntax for action " + action )
if desc=="" and self.broken : outfile.write( value )
else : outfile.write('<div class="tooltip">' + value + '<div class="right">' + desc + '<i></i></div></div>')
elif ttype==Name.Constant :
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name='PlumedToHTML',
version='0.59',
version='0.60',
author="Gareth Tribello",
author_email="[email protected]",
description="A package for creating pretified HTML for PLUMED files",
Expand Down

0 comments on commit 1ca8779

Please sign in to comment.