Skip to content

Commit

Permalink
removed Python 3.6 specific syntax. Cleaned some docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
verybadsoldier committed Aug 24, 2018
1 parent d230eb3 commit 9a0d84a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions sacredboard/app/data/filesdao.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"""
Interface for accessing Sacred files.
"""
"""Interface for accessing Sacred files."""


class FilesDAO:
"""
Interface for accessing files.
"""
"""Interface for accessing files."""

def get(self, file_id):
"""
Expand Down
4 changes: 2 additions & 2 deletions sacredboard/app/webapi/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _get_binary_info(binary: bytes):
hex_data += " "
hex_data += hex(binary[i])
hex_data += " ..."
return f"Binary data\nLength: {len(binary)}\nFirst 10 bytes: {hex_data}"
return "Binary data\nLength: {}\nFirst 10 bytes: {}".format(len(binary), hex_data)


def get_file(file_id: str, download):
Expand Down Expand Up @@ -85,7 +85,7 @@ def get_files_zip(run_id: int, filetype: _FileType):
for f in target_files:
# source and artifact files use a different data structure
file_id = f['file_id'] if 'file_id' in f else f[1]
file: gridfs.GridOut = dao_files.get(file_id)
file = dao_files.get(file_id)
data = zipfile.ZipInfo(file.filename, date_time=file.upload_date.timetuple())
data.compress_type = zipfile.ZIP_DEFLATED
zf.writestr(data, file.read())
Expand Down

0 comments on commit 9a0d84a

Please sign in to comment.