Skip to content

Commit

Permalink
Merge branch 'version/2.5'
Browse files Browse the repository at this point in the history
* version/2.5:
  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 3d7daeb + b6e8c94 commit 6be68b3
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 @@ -27,7 +27,9 @@ class TestRunnable(eHive.BaseRunnable):
def param_defaults(self):
return {
'alpha' : 37,
'beta' : 78
'beta' : 78,
'gamma' : '#alpha#',
'delta' : 'one#hash',
}

def fetch_input(self):
Expand All @@ -36,6 +38,8 @@ def fetch_input(self):
print("beta is", self.param_required('beta'))
self.temp_dir = self.worker_temp_directory()
print("my directory name is", self.temp_dir)
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 6be68b3

Please sign in to comment.