execnb 0.1.9__tar.gz → 0.1.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: execnb
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: A description of your project
5
5
  Home-page: https://github.com/AnswerDotAI/execnb/
6
6
  Author: Jeremy Howard
@@ -48,7 +48,7 @@ mamba installed.)
48
48
  ## How to use
49
49
 
50
50
  Use
51
- [`CaptureShell`](https://fastai.github.io/execnb/shell.html#captureshell)
51
+ [`CaptureShell`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell)
52
52
  to run Jupyter code and capture notebook outputs, without running a
53
53
  Jupyter server (or even having it installed):
54
54
 
@@ -69,7 +69,7 @@ s.run('1+1')
69
69
  'execution_count': 1}]
70
70
 
71
71
  To execute a notebook and save it with outputs filled in, use
72
- [`CaptureShell.execute`](https://fastai.github.io/execnb/shell.html#captureshell.execute):
72
+ [`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
73
73
 
74
74
  ``` python
75
75
  try:
@@ -81,7 +81,7 @@ finally: Path('tmp.ipynb').unlink()
81
81
  [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': 3, 'metadata': {}, 'output_type': 'execute_result'}]
82
82
 
83
83
  You can also execute notebooks from the command line with
84
- [`exec_nb`](https://fastai.github.io/execnb/shell.html#exec_nb):
84
+ [`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
85
85
 
86
86
  ``` python
87
87
  !exec_nb --help
@@ -23,7 +23,7 @@ mamba installed.)
23
23
  ## How to use
24
24
 
25
25
  Use
26
- [`CaptureShell`](https://fastai.github.io/execnb/shell.html#captureshell)
26
+ [`CaptureShell`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell)
27
27
  to run Jupyter code and capture notebook outputs, without running a
28
28
  Jupyter server (or even having it installed):
29
29
 
@@ -44,7 +44,7 @@ s.run('1+1')
44
44
  'execution_count': 1}]
45
45
 
46
46
  To execute a notebook and save it with outputs filled in, use
47
- [`CaptureShell.execute`](https://fastai.github.io/execnb/shell.html#captureshell.execute):
47
+ [`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
48
48
 
49
49
  ``` python
50
50
  try:
@@ -56,7 +56,7 @@ finally: Path('tmp.ipynb').unlink()
56
56
  [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': 3, 'metadata': {}, 'output_type': 'execute_result'}]
57
57
 
58
58
  You can also execute notebooks from the command line with
59
- [`exec_nb`](https://fastai.github.io/execnb/shell.html#exec_nb):
59
+ [`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
60
60
 
61
61
  ``` python
62
62
  !exec_nb --help
@@ -0,0 +1 @@
1
+ __version__ = "0.1.11"
@@ -2,8 +2,8 @@
2
2
 
3
3
  d = { 'settings': { 'branch': 'master',
4
4
  'doc_baseurl': '/execnb/',
5
- 'doc_host': 'https://fastai.github.io',
6
- 'git_url': 'https://github.com/fastai/execnb/',
5
+ 'doc_host': 'https://AnswerDotAI.github.io',
6
+ 'git_url': 'https://github.com/AnswerDotAI/execnb/',
7
7
  'lib_path': 'execnb'},
8
8
  'syms': { 'execnb.nbio': { 'execnb.nbio.NbCell': ('nbio.html#nbcell', 'execnb/nbio.py'),
9
9
  'execnb.nbio.NbCell.__eq__': ('nbio.html#nbcell.__eq__', 'execnb/nbio.py'),
@@ -18,7 +18,7 @@ from IPython.core.interactiveshell import InteractiveShell, ExecutionInfo, Execu
18
18
  from IPython.core.displayhook import DisplayHook
19
19
  from IPython.utils.capture import capture_output
20
20
  from IPython.utils.text import strip_ansi
21
- from IPython.core.completer import IPCompleter,provisionalcompleter
21
+ from IPython.core.completer import IPCompleter,provisionalcompleter,Completer
22
22
  from IPython.core.hooks import CommandChainDispatcher
23
23
  from IPython.core.completerlib import module_completer
24
24
  from IPython.utils.strdispatch import StrDispatch
@@ -99,8 +99,8 @@ def run_cell(self:CaptureShell, raw_cell, store_history=False, silent=False, she
99
99
 
100
100
  # %% ../nbs/02_shell.ipynb
101
101
  def format_exc(e):
102
- "Format exception `e` as a string"
103
- return ''.join(traceback.format_exception(type(e), e, e.__traceback__))
102
+ "Format exception `e` as a string list"
103
+ return traceback.format_exception(type(e), e, e.__traceback__)
104
104
 
105
105
  # %% ../nbs/02_shell.ipynb
106
106
  def _out_stream(text, name): return dict(name=name, output_type='stream', text=text.splitlines(True))
@@ -131,7 +131,8 @@ def _out_nb(o, fmt):
131
131
  if r is not None and not o.quiet:
132
132
  res.append(_mk_out(*fmt.format(r), 'execute_result'))
133
133
  if 'execution_count' not in o: o['execution_count']=None
134
- for p in res: p['execution_count'] = o['execution_count']
134
+ for p in res:
135
+ if p["output_type"]=="execute_result": p['execution_count'] = o['execution_count']
135
136
  return res
136
137
 
137
138
  # %% ../nbs/02_shell.ipynb
@@ -306,9 +307,9 @@ class SmartCompleter(IPCompleter):
306
307
  def __call__(self, c):
307
308
  if not c: return []
308
309
  with provisionalcompleter():
309
- return [o.text.rpartition('.')[-1]
310
- for o in self.completions(c, len(c))
311
- if o.type not in ('magic', 'path')]
310
+ res = [o.text.rpartition('.')[-1] for o in self.completions(c, len(c)) if o.type!='magic']
311
+ if res and res[0][-1]=='=': res = [o for o in res if o[-1]=='=']
312
+ return res
312
313
 
313
314
  # %% ../nbs/02_shell.ipynb
314
315
  @patch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: execnb
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: A description of your project
5
5
  Home-page: https://github.com/AnswerDotAI/execnb/
6
6
  Author: Jeremy Howard
@@ -48,7 +48,7 @@ mamba installed.)
48
48
  ## How to use
49
49
 
50
50
  Use
51
- [`CaptureShell`](https://fastai.github.io/execnb/shell.html#captureshell)
51
+ [`CaptureShell`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell)
52
52
  to run Jupyter code and capture notebook outputs, without running a
53
53
  Jupyter server (or even having it installed):
54
54
 
@@ -69,7 +69,7 @@ s.run('1+1')
69
69
  'execution_count': 1}]
70
70
 
71
71
  To execute a notebook and save it with outputs filled in, use
72
- [`CaptureShell.execute`](https://fastai.github.io/execnb/shell.html#captureshell.execute):
72
+ [`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
73
73
 
74
74
  ``` python
75
75
  try:
@@ -81,7 +81,7 @@ finally: Path('tmp.ipynb').unlink()
81
81
  [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': 3, 'metadata': {}, 'output_type': 'execute_result'}]
82
82
 
83
83
  You can also execute notebooks from the command line with
84
- [`exec_nb`](https://fastai.github.io/execnb/shell.html#exec_nb):
84
+ [`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
85
85
 
86
86
  ``` python
87
87
  !exec_nb --help
@@ -9,7 +9,7 @@ user = AnswerDotAI
9
9
  author = Jeremy Howard
10
10
  author_email = j@fast.ai
11
11
  branch = master
12
- version = 0.1.9
12
+ version = 0.1.11
13
13
  min_python = 3.7
14
14
  requirements = fastcore>=1.5.5 ipython
15
15
  dev_requirements = matplotlib Pillow mistletoe
@@ -1 +0,0 @@
1
- __version__ = "0.1.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes