Show More
@@ -24,7 +24,7 b' from .nbbase import new_code_cell, new_text_cell, new_worksheet, new_notebook' | |||||
24 | # Code |
|
24 | # Code | |
25 | #----------------------------------------------------------------------------- |
|
25 | #----------------------------------------------------------------------------- | |
26 |
|
26 | |||
27 |
_encoding_declaration_re = re.compile(r"^# |
|
27 | _encoding_declaration_re = re.compile(r"^#.*coding[:=]\s*([-\w.]+)") | |
28 |
|
28 | |||
29 | class PyReaderError(Exception): |
|
29 | class PyReaderError(Exception): | |
30 | pass |
|
30 | pass | |
@@ -113,7 +113,7 b' class PyReader(NotebookReader):' | |||||
113 | class PyWriter(NotebookWriter): |
|
113 | class PyWriter(NotebookWriter): | |
114 |
|
114 | |||
115 | def writes(self, nb, **kwargs): |
|
115 | def writes(self, nb, **kwargs): | |
116 | lines = [u'# coding: utf-8'] |
|
116 | lines = [u'# -*- coding: utf-8 -*-'] | |
117 | lines.extend([u'# <nbformat>2</nbformat>','']) |
|
117 | lines.extend([u'# <nbformat>2</nbformat>','']) | |
118 | for ws in nb.worksheets: |
|
118 | for ws in nb.worksheets: | |
119 | for cell in ws.cells: |
|
119 | for cell in ws.cells: |
General Comments 0
You need to be logged in to leave comments.
Login now