Skip to content

Commit

Permalink
Filesystem wrapper can now create text files. Provenance attachment f…
Browse files Browse the repository at this point in the history
…iles ignored.
  • Loading branch information
JasperVanDenBosch committed Feb 5, 2015
1 parent ca63ad4 commit 7894dcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Provenance storage files
provenance.json
provenance.html
*.provenance

# Gedit autosave files
*~
Expand Down
10 changes: 10 additions & 0 deletions niprov/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ def read(self, path):
contents = fhandle.read()
return contents

def write(self, path, content):
"""Write string content to a textfile.
Args:
path: Path to the file to read.
content (str): What to fill the file with
"""
with open(path, 'w') as fhandle:
fhandle.write(content)

def getsize(self, path):
return os.path.getsize(path)

Expand Down

0 comments on commit 7894dcf

Please sign in to comment.