Skip to content

Commit

Permalink
Merge pull request #39 from pepkit/fix
Browse files Browse the repository at this point in the history
Fix problem with double slashes in templates
  • Loading branch information
nsheff committed Jul 17, 2019
2 parents 3813a40 + c7bc359 commit 325cc88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions divvy/compute.py
Expand Up @@ -108,7 +108,9 @@ def default_config_file(self):
return os.path.join(
self.templates_folder, "default_compute_settings.yaml")

@property
# Warning: template cannot be a property, because otherwise
# it will get treated as a PathExAttMap treats all properties, which
# is that it will turn any double-slashes into single slashes.
def template(self):
"""
Get the currently active submission template.
Expand All @@ -118,6 +120,8 @@ def template(self):
with open(self.compute.submission_template, 'r') as f:
return f.read()



@property
def templates_folder(self):
"""
Expand Down Expand Up @@ -256,7 +260,7 @@ def write_script(self, output_path, extra_vars=None):
for kvs in reversed(extra_vars):
variables.update(kvs)
_LOGGER.info("Writing script to {}".format(os.path.abspath(output_path)))
return write_submit_script(output_path, self.template, variables)
return write_submit_script(output_path, self.template(), variables)

def _handle_missing_env_attrs(self, config_file, when_missing):
""" Default environment settings aren't required; warn, though. """
Expand Down

0 comments on commit 325cc88

Please sign in to comment.