From 5aa788d54d6d779b7a58b31e7487c1ac12bcc8d3 2012-10-30 21:29:13 From: Matthias BUSSONNIER Date: 2012-10-30 21:29:13 Subject: [PATCH] remove abspath in conversion process --- diff --git a/converters/base.py b/converters/base.py index 42bb376..a896cb2 100755 --- a/converters/base.py +++ b/converters/base.py @@ -72,7 +72,7 @@ class Converter(object): if not os.path.isdir(files_dir): os.mkdir(files_dir) self.infile_root = infile_root - self.files_dir = os.path.abspath(files_dir) + self.files_dir = files_dir self.outbase = os.path.join(self.infile_dir, infile_root) def __del__(self): diff --git a/tests/ipynbref/IntroNumPy.orig.md b/tests/ipynbref/IntroNumPy.orig.md index c0462c4..05e83ae 100644 --- a/tests/ipynbref/IntroNumPy.orig.md +++ b/tests/ipynbref/IntroNumPy.orig.md @@ -106,7 +106,7 @@ Let's plot both the function and the area below it in the trapezoid approximatio -![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg) +![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg) Compute the integral both at high accuracy and with the trapezoid approximation @@ -843,7 +843,7 @@ The most frequently used function is simply called `plot`, here is how you can m -![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg) +![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg) You can control the style, color and other properties of the markers, for example: @@ -853,7 +853,7 @@ You can control the style, color and other properties of the markers, for exampl -![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg) +![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg)
plt.plot(x, y, 'o', markersize=5, color='r');
@@ -861,7 +861,7 @@ You can control the style, color and other properties of the markers, for exampl
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg)
 
 
 We will now see how to create a few other common plot types, such as a simple error plot:
@@ -882,7 +882,7 @@ We will now see how to create a few other common plot types, such as a simple er
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg)
 
 
 A simple log plot
@@ -894,7 +894,7 @@ A simple log plot
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg)
 
 
 A histogram annotated with text inside the plot, using the `text` function:
@@ -916,7 +916,7 @@ A histogram annotated with text inside the plot, using the `text` function:
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg)
 
 
 ## Image display
@@ -929,7 +929,7 @@ The `imshow` command can display single or multi-channel images.  A simple array
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg)
 
 
 A real photograph is a multichannel image, `imshow` interprets it correctly:
@@ -943,7 +943,7 @@ A real photograph is a multichannel image, `imshow` interprets it correctly:
     Dimensions of the array img: (375, 500, 3)
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg)
 
 
 ## Simple 3d plotting with matplotlib
@@ -979,7 +979,7 @@ A simple surface plot:
 
 
 
-![](/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg)
+![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg)
 
 
 # IPython: a powerful interactive environment
diff --git a/tests/ipynbref/IntroNumPy.orig.py b/tests/ipynbref/IntroNumPy.orig.py
index 293a739..17b49aa 100644
--- a/tests/ipynbref/IntroNumPy.orig.py
+++ b/tests/ipynbref/IntroNumPy.orig.py
@@ -100,7 +100,7 @@ plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4)
 plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', fontsize=20);
 
 # Out[3]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg
 
 # Compute the integral both at high accuracy and with the trapezoid approximation
 
@@ -749,7 +749,7 @@ plt.xlabel('x')
 plt.ylabel('y');
 
 # Out[60]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg
 
 # You can control the style, color and other properties of the markers, for example:
 
@@ -757,13 +757,13 @@ plt.ylabel('y');
 plt.plot(x, y, linewidth=2);
 
 # Out[61]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg
 
 # In[62]:
 plt.plot(x, y, 'o', markersize=5, color='r');
 
 # Out[62]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg
 
 # We will now see how to create a few other common plot types, such as a simple error plot:
 
@@ -782,7 +782,7 @@ plt.errorbar(x, y, xerr=0.2, yerr=0.4)
 plt.title("Simplest errorbars, 0.2 in x, 0.4 in y");
 
 # Out[63]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg
 
 # A simple log plot
 
@@ -792,7 +792,7 @@ y = np.exp(-x**2)
 plt.semilogy(x, y);
 
 # Out[64]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg
 
 # A histogram annotated with text inside the plot, using the `text` function:
 
@@ -812,7 +812,7 @@ plt.axis([40, 160, 0, 0.03])
 plt.grid(True)
 
 # Out[65]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg
 
 ### Image display
 
@@ -823,7 +823,7 @@ from matplotlib import cm
 plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest');
 
 # Out[66]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg
 
 # A real photograph is a multichannel image, `imshow` interprets it correctly:
 
@@ -835,7 +835,7 @@ plt.imshow(img);
 # Out[67]:
 #     Dimensions of the array img: (375, 500, 3)
 # 
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg
 
 ### Simple 3d plotting with matplotlib
 
@@ -867,7 +867,7 @@ surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
 ax.set_zlim3d(-1.01, 1.01);
 
 # Out[72]:
-# image file: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg
+# image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg
 
 ## IPython: a powerful interactive environment
 
diff --git a/tests/ipynbref/IntroNumPy.orig.rst b/tests/ipynbref/IntroNumPy.orig.rst
index 51fb4f5..b2f5346 100644
--- a/tests/ipynbref/IntroNumPy.orig.rst
+++ b/tests/ipynbref/IntroNumPy.orig.rst
@@ -210,7 +210,7 @@ In[3]:
     plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4)
     plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', fontsize=20);
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg
 
 Compute the integral both at high accuracy and with the trapezoid
 approximation
@@ -1328,7 +1328,7 @@ In[60]:
     plt.xlabel('x')
     plt.ylabel('y');
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg
 
 You can control the style, color and other properties of the markers,
 for example:
@@ -1339,7 +1339,7 @@ In[61]:
 
     plt.plot(x, y, linewidth=2);
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg
 
 In[62]:
 
@@ -1347,7 +1347,7 @@ In[62]:
 
     plt.plot(x, y, 'o', markersize=5, color='r');
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg
 
 We will now see how to create a few other common plot types, such as a
 simple error plot:
@@ -1369,7 +1369,7 @@ In[63]:
     plt.errorbar(x, y, xerr=0.2, yerr=0.4)
     plt.title("Simplest errorbars, 0.2 in x, 0.4 in y");
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg
 
 A simple log plot
 
@@ -1381,7 +1381,7 @@ In[64]:
     y = np.exp(-x**2)
     plt.semilogy(x, y);
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg
 
 A histogram annotated with text inside the plot, using the ``text``
 function:
@@ -1404,7 +1404,7 @@ In[65]:
     plt.axis([40, 160, 0, 0.03])
     plt.grid(True)
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg
 
 Image display
 -------------
@@ -1419,7 +1419,7 @@ In[66]:
     from matplotlib import cm
     plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest');
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg
 
 A real photograph is a multichannel image, ``imshow`` interprets it
 correctly:
@@ -1437,7 +1437,7 @@ In[67]:
     Dimensions of the array img: (375, 500, 3)
 
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg
 
 Simple 3d plotting with matplotlib
 ----------------------------------
@@ -1479,7 +1479,7 @@ In[72]:
             linewidth=0, antialiased=False)
     ax.set_zlim3d(-1.01, 1.01);
 
-.. image:: /Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg
+.. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg
 
 IPython: a powerful interactive environment
 ===========================================
diff --git a/tests/ipynbref/IntroNumPy.orig.tex b/tests/ipynbref/IntroNumPy.orig.tex
index 5db0acd..b6840cd 100644
--- a/tests/ipynbref/IntroNumPy.orig.tex
+++ b/tests/ipynbref/IntroNumPy.orig.tex
@@ -332,7 +332,7 @@ plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', f
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1496,7 +1496,7 @@ plt.ylabel('y');
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1512,7 +1512,7 @@ plt.plot(x, y, linewidth=2);
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1525,7 +1525,7 @@ plt.plot(x, y, 'o', markersize=5, color='r');
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1552,7 +1552,7 @@ plt.title("Simplest errorbars, 0.2 in x, 0.4 in y");
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1569,7 +1569,7 @@ plt.semilogy(x, y);
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1597,7 +1597,7 @@ plt.grid(True)
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1615,7 +1615,7 @@ plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest');
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1636,7 +1636,7 @@ plt.imshow(img);
 Dimensions of the array img: (375, 500, 3)
 \end{verbatim}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.pdf}
 \par
 \end{center}
 \end{codeoutput}
@@ -1682,7 +1682,7 @@ ax.set_zlim3d(-1.01, 1.01);
 \end{codeinput}
 \begin{codeoutput}
 \begin{center}
-\includegraphics[width=6in]{/Users/bussonniermatthias/nbconvert/tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.pdf}
+\includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.pdf}
 \par
 \end{center}
 \end{codeoutput}