Skip to content

Commit

Permalink
Fix to ensure that only actions in the manual are added to lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed May 8, 2024
1 parent 9120d47 commit 082abf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions PlumedToHTML/PlumedFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ def format(self, tokensource, outfile):
elif ttype==Keyword :
# Name of action
action, notooltips = value.strip().upper(), False
# Store name of action in set that contains all action names
self.actions.add(action)
if action not in self.keyword_dict :
if self.hasload or self.broken : notooltips = True
else : raise Exception("no action " + action + " in dictionary")
else :
# Store name of action in set that contains all action names
self.actions.add(action)
if default_state!=0 or shortcut_state==1 :
if label!="" and label!=act_label : raise Exception("mismatched label and act_label for shortcut/default")
if notooltips :
Expand Down
2 changes: 1 addition & 1 deletion tdata/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{
"input": "LOAD FILE=Distance2.cpp\ncv: DEBYE_STRUCTURE_FACTOR CUTOFF=10.5 ACTIVE_Q=2.070595",
"index": 12,
"actions": ["LOAD", "DEBYE_STRUCTURE_FACTOR"],
"actions": ["LOAD"],
"tooltips": ["LOAD", "FILE", "DEBYE_STRUCTURE_FACTOR"],
"badges": ["fail", "load"]
},
Expand Down

0 comments on commit 082abf7

Please sign in to comment.