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

Fixes #634 bug: no metadata attribute #635

Merged
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.idea
.vscode
.build
.cache
.coverage
Expand All @@ -18,3 +16,13 @@ docs/_build

# Will be created by postBuild
demo/get_started.ipynb

# jetbrains ide stuff
*.iml
.idea/

# vscode ide stuff
*.code-workspace
.history
.vscode/*
!.vscode/*.template
13 changes: 10 additions & 3 deletions jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,22 @@ def save_one_file(path, fmt):
text_model = dict(
type="file",
format="text",
content=jupytext.writes(model["content"], fmt=fmt),
content=jupytext.writes(
nbformat.from_dict(model["content"]), fmt=fmt
),
)

return self.super.save(text_model, path)

return write_pair(path, jupytext_formats, save_one_file)

except Exception as err:
raise HTTPError(400, str(err))
except Exception as e:
self.log.error(
u"Error while saving file: %s %s", path, e, exc_info=True
)
raise HTTPError(
500, u"Unexpected error while saving file: %s %s" % (path, e)
)

def get(
self,
Expand Down