Skip to content

Commit

Permalink
Set default file permissions in matplotlib formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
cverstege authored Oct 10, 2024
1 parent 673c2ac commit caacf90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion law/contrib/matplotlib/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


from law.target.formatter import Formatter
from law.target.file import get_path
from law.target.file import get_path, FileSystemTarget


class MatplotlibFormatter(Formatter):
Expand All @@ -23,3 +23,5 @@ def accepts(cls, path, mode):
@classmethod
def dump(cls, path, fig, *args, **kwargs):
fig.savefig(get_path(path), *args, **kwargs)
if isinstance(path, FileSystemTarget):
path.chmod(path.fs.default_file_perm)

0 comments on commit caacf90

Please sign in to comment.