Skip to content

Commit

Permalink
Merge branch 'version/2.4' into version/2.5
Browse files Browse the repository at this point in the history
* version/2.4:
  Add substitution example + one hash, to TestRunnable.py
  Comment not a question
  Allow a single hash in a string without substitution (in python wrapper)
  • Loading branch information
ens-bwalts committed Oct 5, 2020
2 parents 43541ab + 4f0d2e2 commit b6e8c94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions wrappers/python3/eHive/Params.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def subst_all_hashpairs(self, structure, callback):
The result is a string (like structure)
"""
self.debug_print("subst_all_hashpairs", structure)

# Allow a single literal hash
if structure.count("#") == 1:
return structure

result = []
while True:
(head,_,tmp) = structure.partition('#')
Expand Down
6 changes: 5 additions & 1 deletion wrappers/python3/eHive/examples/TestRunnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ class TestRunnable(eHive.BaseRunnable):
def param_defaults(self):
return {
'alpha' : 37,
'beta' : 78
'beta' : 78,
'gamma' : '#alpha#',
'delta' : 'one#hash',
}

def fetch_input(self):
self.warning("Fetch the world !")
print("alpha is", self.param_required('alpha'))
print("beta is", self.param_required('beta'))
print("gamma is", self.param_required('gamma'))
print("delta is", self.param_required('delta'))

def run(self):
self.warning("Run the world !")
Expand Down

0 comments on commit b6e8c94

Please sign in to comment.