Skip to content

Commit

Permalink
add: filepath and filename attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Sep 5, 2018
1 parent 9302752 commit 26c8af5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ during the templating:

- ``{{ name }}``: Extracted from the filename, without the
extension.
- ``{{ filename }}``: Filename, with extension.
- ``{{ filepath }}``: Full path to the file.
- ``{{ stoichiometry }}``. (Gaussian only).
- ``{{ imaginary_freqs }}``: Number of negative frequencies.
- ``{{ mean_of_electrons }}``: Mean of ``alphaelectrons`` and
Expand Down
4 changes: 2 additions & 2 deletions esigen/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def report(self, template='default.md', process_markdown=False, preview=None):
elif preview == 'static_server':
image = os.path.basename(self.render_with_pymol_server())

rendered = t.render(name=self.name, image=image, preview=preview,
**self.data_as_dict())
rendered = t.render(name=self.name, filepath=self.path, filename=os.path.basename(self.path),
image=image, preview=preview, **self.data_as_dict())
if process_markdown:
return markdown(rendered, extensions=['markdown.extensions.tables',
'markdown.extensions.fenced_code',
Expand Down

0 comments on commit 26c8af5

Please sign in to comment.