Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
username = owner['username']
# Cache slug for further commits
set_notebook_slug(filename, slug)
# Attach environment, files and outputs
_capture_environment(environment, slug, version)
_attach_files(files, slug, version, exclude_files=filename)
_attach_files(outputs, slug, version, output=True)
if not git_message or git_message == 'auto':
git_message = message or 'jovian commit ' + username + '/' + title + ' v' + str(version)
_perform_git_commit(filename, git_commit, git_message)
_attach_records(slug, version)
log('Committed successfully! ' + urljoin(read_webapp_url(), username, title))
return urljoin(read_webapp_url(), username, title)
log('Creating a new project "' + username + '/' + project_title + '"')
return project_title, None
# Extract information from metadata
username = metadata['owner']['username']
project_title = metadata['title']
project_id = metadata['slug']
# Check if the current user can commit to this project
permissions = api.get_gist_access(project_id)
if not permissions['write']:
return project_title, None
# Log whether this is an update or creation
if project_id is None:
log('Creating a new notebook on ' + read_webapp_url())
else:
log('Updating notebook "' + username + "/" + project_title + '" on ' + read_webapp_url())
return project_title, project_id
# Extract information from metadata
username = metadata['owner']['username']
project_title = metadata['title']
project_id = metadata['slug']
# Check if the current user can commit to this project
permissions = api.get_gist_access(project_id)
if not permissions['write']:
return project_title, None
# Log whether this is an update or creation
if project_id is None:
log('Creating a new notebook on ' + read_webapp_url())
else:
log('Updating notebook "' + username + "/" + project_title + '" on ' + read_webapp_url())
return project_title, project_id