Skip to content

Commit 8fbf1cb

Browse files
committed
switch quotes so we are not fighting black
1 parent 1ccd06e commit 8fbf1cb

File tree

7 files changed

+74
-74
lines changed

7 files changed

+74
-74
lines changed

coverage.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ wvpy/util.py 321 7 98%
4141
---------------------------------------------
4242
TOTAL 591 160 73%
4343

44-
======================= 20 passed, 2 warnings in 16.97s ========================
44+
======================= 20 passed, 2 warnings in 17.61s ========================

pkg/build/lib/wvpy/jtools.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
def convert_py_code_to_notebook(text: str) -> nbformat.notebooknode.NotebookNode:
2121
"""
2222
Convert python text to a notebook.
23-
"''' begin text" ends any open blocks, and starts a new markdown block
24-
"''' # end text" ends text, and starts a new code block
25-
"'''end code'''" ends code blocks, and starts a new code block
23+
"''' begin text" ends any open blocks, and starts a new markdown block (triple double quotes also allowed)
24+
"''' # end text" ends text, and starts a new code block (triple double quotes also allowed)
25+
"'''end code'''" ends code blocks, and starts a new code block (triple double quotes also allowed)
2626
2727
:param text: Python text to convert.
2828
:return: a notebook
@@ -99,9 +99,9 @@ def prepend_code_cell_to_notebook(
9999
def convert_py_file_to_notebook(*, py_file: str, ipynb_file: str) -> None:
100100
"""
101101
Convert python text to a notebook.
102-
"''' begin text" ends any open blocks, and starts a new markdown block
103-
"''' # end text" ends text, and starts a new code block
104-
"'''end code'''" ends code blocks, and starts a new code block
102+
"''' begin text" ends any open blocks, and starts a new markdown block (triple double quotes also allowed)
103+
"''' # end text" ends text, and starts a new code block (triple double quotes also allowed)
104+
"'''end code'''" ends code blocks, and starts a new code block (triple double quotes also allowed)
105105
106106
:param py_file: Path to python source file.
107107
:param ipynb_file: Path to notebook result file.
@@ -120,9 +120,9 @@ def convert_py_file_to_notebook(*, py_file: str, ipynb_file: str) -> None:
120120
def convert_notebook_code_to_py(nb: nbformat.notebooknode.NotebookNode) -> str:
121121
"""
122122
Convert ipython notebook inputs to a py code.
123-
"''' begin text" ends any open blocks, and starts a new markdown block
124-
"''' # end text" ends text, and starts a new code block
125-
"'''end code'''" ends code blocks, and starts a new code block
123+
"''' begin text" ends any open blocks, and starts a new markdown block (triple double quotes also allowed)
124+
"''' # end text" ends text, and starts a new code block (triple double quotes also allowed)
125+
"'''end code'''" ends code blocks, and starts a new code block (triple double quotes also allowed)
126126
127127
:param nb: notebook
128128
:return: Python source code
@@ -133,13 +133,13 @@ def convert_notebook_code_to_py(nb: nbformat.notebooknode.NotebookNode) -> str:
133133
if len(cell.source.strip()) > 0:
134134
if cell.cell_type == 'code':
135135
if code_needs_end:
136-
res.append("\n'''end code'''\n")
136+
res.append('\n"""end code"""\n')
137137
res.append(cell.source.strip('\n'))
138138
code_needs_end = True
139139
else:
140-
res.append("\n''' begin text")
140+
res.append('\n""" begin text')
141141
res.append(cell.source.strip('\n'))
142-
res.append("''' # end text\n")
142+
res.append('""" # end text\n')
143143
code_needs_end = False
144144
res_text = '\n' + ('\n'.join(res)).strip('\n') + '\n\n'
145145
return res_text
@@ -148,9 +148,9 @@ def convert_notebook_code_to_py(nb: nbformat.notebooknode.NotebookNode) -> str:
148148
def convert_notebook_file_to_py(*, ipynb_file: str, py_file: str) -> None:
149149
"""
150150
Convert ipython notebook inputs to a py file.
151-
"''' begin text" ends any open blocks, and starts a new markdown block
152-
"''' # end text" ends text, and starts a new code block
153-
"'''end code'''" ends code blocks, and starts a new code block
151+
"''' begin text" ends any open blocks, and starts a new markdown block (triple double quotes also allowed)
152+
"''' # end text" ends text, and starts a new code block (triple double quotes also allowed)
153+
"'''end code'''" ends code blocks, and starts a new code block (triple double quotes also allowed)
154154
155155
:param ipynb_file: Path to notebook input file.
156156
:param py_file: Path to python result file.
34 Bytes
Binary file not shown.

pkg/dist/wvpy-0.3.4.tar.gz

26 Bytes
Binary file not shown.

pkg/docs/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)