Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reader_params #216

Merged
merged 6 commits into from
Jan 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions solvebio/resource/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Manifest(object):
def __init__(self):
self.manifest = {'files': []}

def add_file(self, path):
def add_file(self, path, **kwargs):
default_upload_path = solvebio.Vault.get_or_create_uploads_path()
vault_name = solvebio.Vault.get_personal_vault().name
print("Uploading file: {0} to {1}".format(path, default_upload_path))
Expand All @@ -37,18 +37,15 @@ def add_file(self, path):
'object_id': file_.id,
'name': file_.filename,
'md5': file_.md5,
'size': file_.size
'size': file_.size,
'reader_params': kwargs.get('reader_params'),
'entity_params': kwargs.get('entity_params'),
'validation_params': kwargs.get('validation_params')
})

def add_url(self, url, **kwargs):
self.manifest['files'].append({
'url': url,
'name': kwargs.get('name'),
'format': kwargs.get('format'),
'size': kwargs.get('size'),
'md5': kwargs.get('md5'),
'base64_md5': kwargs.get('base64_md5')
})
manifest_item = dict(url=url, **kwargs)
self.manifest['files'].append(manifest_item)

def add(self, *args):
"""
Expand Down