Skip to content

Commit 88cff63

Browse files
author
Solveit
committed
Clean up notebook outputs to use generic /path instead of system-specific paths
1 parent f876222 commit 88cff63

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

nbs/12_tools.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,17 +461,17 @@
461461
"name": "stdout",
462462
"output_type": "stream",
463463
"text": [
464-
"Directory contents of /app/data/repos/fastcore/nbs:\n",
465-
"/app/data/repos/fastcore/nbs/000_tour.ipynb\n",
466-
"/app/data/repos/fastcore/nbs/00_test.ipynb\n",
467-
"/app/data/repos/fastcore/nbs/01_basics.ipynb\n",
468-
"/app/data/repos/fastcore/nbs/02_foundation.ipynb\n",
469-
"/app/data/repos/fastcore/nbs/03_xtras.ipynb\n"
464+
"Directory contents of /path:\n",
465+
"/path/000_tour.ipynb\n",
466+
"/path/00_test.ipynb\n",
467+
"/path/01_basics.ipynb\n",
468+
"/path/02_foundation.ipynb\n",
469+
"/path/03_xtras.ipynb\n"
470470
]
471471
}
472472
],
473473
"source": [
474-
"print(view('.', (1,5)))"
474+
"print(view('.', (1,5)).replace(os.getcwd(), '/path'))"
475475
]
476476
},
477477
{
@@ -508,14 +508,14 @@
508508
"name": "stdout",
509509
"output_type": "stream",
510510
"text": [
511-
"Created file /app/data/repos/fastcore/nbs/test.txt.\n",
511+
"Created file /path/test.txt.\n",
512512
"Contents:\n",
513513
" 1 │ Hello, world!\n"
514514
]
515515
}
516516
],
517517
"source": [
518-
"print(create('test.txt', 'Hello, world!'))\n",
518+
"print(create('test.txt', 'Hello, world!').replace(os.getcwd(), '/path'))\n",
519519
"f = Path('test.txt')\n",
520520
"test_eq(f.exists(), True)\n",
521521
"print('Contents:\\n', view(f, nums=True))"
@@ -705,7 +705,7 @@
705705
{
706706
"data": {
707707
"text/plain": [
708-
"'Error replacing lines: File not found: /app/data/repos/fastcore/nbs/missing.txt'"
708+
"'Error replacing lines: File not found: /path/missing.txt'"
709709
]
710710
},
711711
"execution_count": null,
@@ -714,7 +714,7 @@
714714
}
715715
],
716716
"source": [
717-
"replace_lines('missing.txt', 1, 2, 'Replaced first two lines')"
717+
"replace_lines('missing.txt', 1, 2, 'Replaced first two lines').replace(os.getcwd(), '/path')"
718718
]
719719
},
720720
{
@@ -867,15 +867,15 @@
867867
"Error: Destination within source range\n",
868868
"Error: Invalid range 10-12\n",
869869
"Error: Invalid destination 99\n",
870-
"Error: File not found: /app/data/repos/fastcore/nbs/mising.txt\n"
870+
"Error: File not found: /path/mising.txt\n"
871871
]
872872
}
873873
],
874874
"source": [
875875
"print(move_lines('move_test.txt', 2, 3, 3)) # dest within source range\n",
876876
"print(move_lines('move_test.txt', 10, 12, 1)) # invalid range\n",
877877
"print(move_lines('move_test.txt', 1, 2, 99)) # invalid destination\n",
878-
"print(move_lines('mising.txt', 1, 2, 99)) # missing file"
878+
"print(move_lines('mising.txt', 1, 2, 99).replace(os.getcwd(), '/path')) # missing file"
879879
]
880880
},
881881
{

0 commit comments

Comments
 (0)